Compare commits
No commits in common. "main" and "0.0.1" have entirely different histories.
3 changed files with 3 additions and 20 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,4 +2,3 @@ keys/
|
||||||
repo/
|
repo/
|
||||||
build/
|
build/
|
||||||
*.list
|
*.list
|
||||||
config_test.json
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"remote_user": "",
|
|
||||||
"remote_server": "",
|
|
||||||
"remote_path": "",
|
|
||||||
"ssh_priv_key_path": ""
|
|
||||||
}
|
|
16
repo-mgmt
16
repo-mgmt
|
@ -4,7 +4,6 @@ readonly PODMAN_IMAGE="noveria:alpine-repo"
|
||||||
readonly ROOT_DIR="$(dirname $(readlink -f $(which ${0})))"
|
readonly ROOT_DIR="$(dirname $(readlink -f $(which ${0})))"
|
||||||
readonly PODMAN_IMAGE_DIR="${ROOT_DIR}/image"
|
readonly PODMAN_IMAGE_DIR="${ROOT_DIR}/image"
|
||||||
|
|
||||||
readonly CONFIG="/etc/repo-mgmt/config.json"
|
|
||||||
readonly KEYS_DIR="${ROOT_DIR}/keys"
|
readonly KEYS_DIR="${ROOT_DIR}/keys"
|
||||||
readonly REPO_DIR="${ROOT_DIR}/repo"
|
readonly REPO_DIR="${ROOT_DIR}/repo"
|
||||||
readonly BUILD_DIR="${ROOT_DIR}/build"
|
readonly BUILD_DIR="${ROOT_DIR}/build"
|
||||||
|
@ -178,16 +177,8 @@ function delete_pkg_from_repo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function publish_repo() {
|
function publish_repo() {
|
||||||
if [[ -z $(jq -r '.remote_user' $CONFIG) || -z $(jq -r '.remote_server' $CONFIG) || -z $(jq -r '.remote_path' $CONFIG) || -z $(jq -r '.ssh_priv_key_path' $CONFIG) ]]; then
|
message_blue_double_colon "Publishing files to remote webserver"
|
||||||
message_error "Config is incomplete. Please fill out first!"
|
message_error "Not yet implemented"
|
||||||
fi
|
|
||||||
local remote_user="$(jq -r '.remote_user' $CONFIG)"
|
|
||||||
local remote_server="$(jq -r '.remote_server' $CONFIG)"
|
|
||||||
local remote_path="$(jq -r '.remote_path' $CONFIG)"
|
|
||||||
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 -e "ssh -i ${ssh_priv_key_path}" --progress --rsync-path="mkdir -p ${remote_path} && rsync" "${REPO_DIR}/" "${remote_user}@${remote_server}:${remote_path}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -229,8 +220,7 @@ function build_pkgs() {
|
||||||
container_run "sudo apk update && sudo apk upgrade && cd /build/$pkg && abuild checksum && abuild -r && find /home/apkbuild/packages/build -name $1*.apk -exec mv {} /build/$1 \;"
|
container_run "sudo apk update && sudo apk upgrade && cd /build/$pkg && abuild checksum && abuild -r && find /home/apkbuild/packages/build -name $1*.apk -exec mv {} /build/$1 \;"
|
||||||
message_blue_single_arrow "Copying package to repo"
|
message_blue_single_arrow "Copying package to repo"
|
||||||
local VERSION_ID=$(container_run "grep VERSION_ID= /etc/os-release")
|
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
|
rm -f "${BUILD_DIR}/$pkg"/*.apk
|
||||||
refresh_repo
|
refresh_repo
|
||||||
sign_repo
|
sign_repo
|
||||||
|
|
Loading…
Reference in a new issue