push.sh: Enable push of testing repository with '-t'

pull/196/head
Jan Houben 7 years ago
parent 3b03b22a3b
commit aee987fa6f
No known key found for this signature in database
GPG Key ID: 6866AADB974DD983
  1. 17
      push.sh
  2. 2
      repo.sh

@ -12,6 +12,7 @@ script_name=$(basename $0)
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
push=0
push_repo=0
push_testing_repo=0
if ! source ${script_dir}/lib.sh; then
@ -32,6 +33,7 @@ usage() {
echo " -n: Dryrun; Output commands, but don't do anything."
echo " -d: Show debug info."
echo " -r: Push the archzfs repositories."
echo " -t: Push the archzfs testing repositories."
echo " -p: Commit changes and push."
echo
echo "Modes:"
@ -73,6 +75,8 @@ for (( a = 0; a < $#; a++ )); do
push=1
elif [[ ${args[$a]} == "-r" ]]; then
push_repo=1
elif [[ ${args[$a]} == "-t" ]]; then
push_testing_repo=1
elif [[ ${args[$a]} == "-h" ]]; then
usage
else
@ -82,7 +86,7 @@ for (( a = 0; a < $#; a++ )); do
done
if [[ ${#modes[@]} -eq 0 && ${push_repo} -eq 0 ]]; then
if [[ ${#modes[@]} -eq 0 && ${push_repo} -eq 0 && ${push_testing_repo} -eq 0 ]]; then
echo
error "A mode must be selected!"
usage
@ -138,8 +142,19 @@ push_repo() {
run_cmd_check 1 "Could not push packages to remote repo!"
}
push_testing_repo() {
if [[ ${dry_run} -eq 1 ]]; then
dry="-n"
elif [[ ${push_testing_repo} -ne 1 ]]; then
return
fi
run_cmd "rsync -vrtlh --delete-before ${repo_basepath}/${repo_basename}-testing ${repo_basepath}/archive_${repo_basename}-testing ${remote_login}:${repo_remote_basepath}/ ${dry}"
run_cmd_check 1 "Could not push packages to remote testing repo!"
}
push_repo
push_testing_repo
if [[ ${#modes[@]} -eq 0 ]]; then
exit
fi

@ -96,7 +96,7 @@ for (( a = 0; a < $#; a++ )); do
fi
done
package_backup_dir="${repo_basepath}/archive_${repo_basename}"
package_backup_dir="${repo_basepath}/archive_${repo_name}"
if [[ $# -lt 1 ]]; then

Loading…
Cancel
Save