Commit b836c803 authored by Luca Giambonini's avatar Luca Giambonini

dinamically set the correct repository name if not defined

we can call sign database in both ways:
_do sign_database $source_repo
_do sign_database
parent 78b12db0
......@@ -105,15 +105,26 @@ function check-upload() {
# sign a remote repository
function sign_database() {
_log build_step "Downloading and signing the [$DEPLOY_REPO] database"
local sign_repository
if [ -z "$1" ]
then
# sign_database was called without argument
sign_repository=$DEPLOY_REPO
else
# sign_database was called with the repository name
sign_repository=$1
fi
_log build_step "Downloading and signing the [$sign_repository] database"
dir=$(mktemp -d)
_do wget -q $DEPLOY_SERVER/packages/$DEPLOY_REPO/x86_64/$DEPLOY_REPO.db.tar.xz -O "$dir/$DEPLOY_REPO.db.tar.xz"
_do wget -q $DEPLOY_SERVER/packages/$DEPLOY_REPO/x86_64/$DEPLOY_REPO.db.tar.gz -O "$dir/$DEPLOY_REPO.db.tar.gz"
echo "$GPG_PASSWORD" | gpg -sb --pinentry-mode loopback --passphrase-fd 0 "$dir/$DEPLOY_REPO.db.tar.xz"
echo "$GPG_PASSWORD" | gpg -sb --pinentry-mode loopback --passphrase-fd 0 "$dir/$DEPLOY_REPO.db.tar.gz"
_do wget -q $DEPLOY_SERVER/packages/$sign_repositoryx86_64/$sign_repository.db.tar.xz -O "$dir/$sign_repository.db.tar.xz"
_do wget -q $DEPLOY_SERVER/packages/$sign_repository/x86_64/$sign_repository.db.tar.gz -O "$dir/$sign_repository.db.tar.gz"
echo "$GPG_PASSWORD" | gpg -sb --pinentry-mode loopback --passphrase-fd 0 "$dir/$sign_repository.db.tar.xz"
echo "$GPG_PASSWORD" | gpg -sb --pinentry-mode loopback --passphrase-fd 0 "$dir/$sign_repository.db.tar.gz"
DB_UPLOAD_LIST=( $(set -o noglob; find $dir -name '*.db.tar.*' \( $(_find_args ${args[@]}) \) -print) )
_log build_step "Start uploading to [$DEPLOY_REPO] the following files ${DB_UPLOAD_LIST[@]}"
_log build_step "Start uploading to [$sign_repository] the following files ${DB_UPLOAD_LIST[@]}"
_do_deploy _upload_files "${DB_UPLOAD_LIST[@]}"
_do rm -rfv $dir
_log success "Database signature done"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment