diff options
Diffstat (limited to 'jjb/kvmfornfv/kvmfornfv-upload-artifact.sh')
-rwxr-xr-x | jjb/kvmfornfv/kvmfornfv-upload-artifact.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh index 190ab4b4d..adf902ec9 100755 --- a/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh +++ b/jjb/kvmfornfv/kvmfornfv-upload-artifact.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -o errexit +set -o nounset if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then JOB_TYPE=${BASH_REMATCH[0]} @@ -11,6 +13,8 @@ case "$JOB_TYPE" in verify) echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..." GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER" + echo "Removing artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER" + gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION ;; daily) echo "Uploding daily artifacts This could take some time..." @@ -22,7 +26,7 @@ case "$JOB_TYPE" in exit 1 esac -gsutil cp -r $WORKSPACE/build_output $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1 +gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1 gsutil -m setmeta -r \ -h "Cache-Control:private, max-age=0, no-transform" \ $GS_UPLOAD_LOCATION > /dev/null 2>&1 |