diff options
author | Dave Wallace <dwallacelf@gmail.com> | 2021-04-16 10:06:36 -0400 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2021-04-16 10:11:38 -0400 |
commit | f8747a9f7a238c033f80c54bd18239915b2c0648 (patch) | |
tree | ec091eac3403db0a5f2f513440ede15bbae1297f /jjb/scripts | |
parent | d8a0b87898170273bb76930c636edfe691354484 (diff) |
Fix backup archive directory structure.
Change-Id: I9fd1194bdb68239df2a6e2c4432ec1849ca12aac
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'jjb/scripts')
-rwxr-xr-x | jjb/scripts/backup_upload_archives.sh | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/jjb/scripts/backup_upload_archives.sh b/jjb/scripts/backup_upload_archives.sh index 0599c9676..8d6a8f495 100755 --- a/jjb/scripts/backup_upload_archives.sh +++ b/jjb/scripts/backup_upload_archives.sh @@ -159,30 +159,19 @@ if __name__ == u"__main__": END_OF_PYTHON_SCRIPT WS_ARCHIVES_DIR="$WORKSPACE/archives" -ARCHIVES_DIR="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER" -ARCHIVES_ZIP_FILE="$WORKSPACE/.archives/archives.zip" +JENKINS_BUILD_ARCHIVE_DIR="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER" TMP_ARCHIVES_DIR="/tmp/archives" mkdir -p $TMP_ARCHIVES_DIR pushd $TMP_ARCHIVES_DIR -if [ -f "$ARCHIVES_ZIP_FILE" ]; then - # FIXME: this branch to be removed upon full transition to lftools: - # we are include_raw from fdio-infra-shiplogs publisher, and - # it already packed everything into archives.zip and removed - # the original archives directory. So just unpack and use that. - echo "Detected existing archives.zip, uploading the contents of it" - unzip "$ARCHIVES_ZIP_FILE" +mkdir -p $JENKINS_BUILD_ARCHIVE_DIR +if [ -e "$WS_ARCHIVES_DIR" ]; then + echo "Found $WS_ARCHIVES_DIR, uploading its contents" + cp -r $WS_ARCHIVES_DIR/* $JENKINS_BUILD_ARCHIVE_DIR else - # the include_raw is done from fdio-infra-publish publisher - mkdir -p "$ARCHIVES_DIR" - if [ -e "$WS_ARCHIVES_DIR" ]; then - echo "Found $WS_ARCHIVES_DIR, uploading its contents" - cp -r "$WS_ARCHIVES_DIR" . - else - echo "No $WS_ARCHIVES_DIR found. Creating a dummy file." - echo "No archives found while doing backup upload" > "$ARCHIVES_DIR/no-archives-found.txt" - fi + echo "No $WS_ARCHIVES_DIR found. Creating a dummy file." + echo "No archives found while doing backup upload" > "$JENKINS_BUILD_ARCHIVE_DIR/no-archives-found.txt" fi echo "Contents of the archives dir:" |