From: Michael Tremer Date: Tue, 11 Feb 2020 10:08:48 +0000 (+0000) Subject: build.sh: Delete successfully uploaded files X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00e27fa774955fddfe0123de4d6cc20940fc107a;p=people%2Fms%2Fnightly-builds.git build.sh: Delete successfully uploaded files This only happend immediately after the build and not on any retries. Signed-off-by: Michael Tremer --- diff --git a/build.sh b/build.sh index cf95550..fcb7699 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ LOCKFILE="/tmp/.nightly-builds.lock" UPLOAD_DIR="${BASEDIR}/upload" UPLOAD_TO="pakfire@fs01.haj.ipfire.org:/pub/nightly" -RSYNC_ARGS=( "--delay-updates" ) +RSYNC_ARGS=( "-avH" "--progress" "--delay-updates" ) extract_installer_from_iso() { local dir="${1}" @@ -169,12 +169,7 @@ build() { ./make.sh --target="${target}" clean # Upload the result - # If that failed, we will keep the result and it will - # be retried with the next build. If that succeeded, the - # build will be removed from disk. - if sync; then - rm -rf "${UPLOAD_DIR}" - fi + sync done popd @@ -186,8 +181,9 @@ sync() { # Acquire a Kerberos ticket for authentication kinit -k -t /etc/krb5.keytab "host/${HOSTNAME}" - rsync -avH --progress "${RSYNC_ARGS[@]}" \ - "${UPLOAD_DIR}/" "${UPLOAD_TO}" + if rsync "${RSYNC_ARGS[@]}" "${UPLOAD_DIR}/" "${UPLOAD_TO}"; then + rm -rf "${UPLOAD_DIR}" + fi } is_locked() {