Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
e4356fe29d | |||
0bcf1973fa | |||
70a82fc0b0 |
1 changed files with 26 additions and 2 deletions
28
repo-mgmt
28
repo-mgmt
|
@ -23,6 +23,30 @@ readonly APKBUILD_GIT_REPO_BASE="https://git.noveria.org/APKBUILD"
|
|||
# Miscellaneous functions
|
||||
##
|
||||
|
||||
function usage() {
|
||||
echo -e "Noveria Alpine Linux repository build management
|
||||
|
||||
Usage: $(basename $0) <operations> [...]
|
||||
|
||||
Operations:
|
||||
Miscellaneous:
|
||||
-h, --help Usage information
|
||||
-p, --publish Publish files to webserver (not yet implemented)
|
||||
--debug Start debug-container bash shell
|
||||
--init Initialize local directories & abuild keys
|
||||
|
||||
Podman:
|
||||
-b, --build (Re)build podman image
|
||||
|
||||
DB management:
|
||||
-d, --delete <pkgname> Delete package
|
||||
-r, --refresh Refresh APKINDEX with packages in repo
|
||||
-s, --sign Sign APKINDEX with abuild private key
|
||||
|
||||
Package management:
|
||||
-k, --apkbuild Build binary package from APKBUILD and move to, refresh and sign local repository
|
||||
"
|
||||
}
|
||||
|
||||
function init_local() {
|
||||
if [[ ! -d "${BUILD_DIR}" || ! -d "${REPO_DIR}" || ! -d "${KEYS_DIR}" || ! -f "${PKG_LIST_FILE}" ]]; then
|
||||
|
@ -163,7 +187,7 @@ function publish_repo() {
|
|||
local ssh_priv_key_path="$(jq -r '.ssh_priv_key_path' $CONFIG)"
|
||||
|
||||
message_blue_double_colon "Publishing files to remote webserver: ${remote_user}@${remote_server}:${remote_path}/"
|
||||
rsync -a --delete --progress --rsync-path="mkdir -p ${remote_path} && rsync" "${REPO_DIR}/" "${remote_user}@${remote_server}:${remote_path}"
|
||||
rsync -a --delete -e "ssh -i ${ssh_priv_key_path}" --progress --rsync-path="mkdir -p ${remote_path} && rsync" "${REPO_DIR}/" "${remote_user}@${remote_server}:${remote_path}"
|
||||
}
|
||||
|
||||
##
|
||||
|
@ -206,7 +230,7 @@ function build_pkgs() {
|
|||
message_blue_single_arrow "Copying package to repo"
|
||||
local VERSION_ID=$(container_run "grep VERSION_ID= /etc/os-release")
|
||||
find $REPO_DIR/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64 -name $1*.apk -exec rm -f {} \;
|
||||
rsync -a --delete-before --progress "${BUILD_DIR}/$pkg"/*.apk "${REPO_DIR}/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64"
|
||||
rsync -a --delete --progress "${BUILD_DIR}/$pkg"/*.apk "${REPO_DIR}/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64"
|
||||
rm -f "${BUILD_DIR}/$pkg"/*.apk
|
||||
refresh_repo
|
||||
sign_repo
|
||||
|
|
Loading…
Reference in a new issue