kvmfornfv: Remove artifacts created for the previous patch of the same change 17/18817/3
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Wed, 17 Aug 2016 09:18:38 +0000 (11:18 +0200)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Wed, 17 Aug 2016 10:29:11 +0000 (12:29 +0200)
Change-Id: I1d92d6b37f99965f3786b3cc9e12ff5a2d1c7f2e
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/kvmfornfv/kvmfornfv-download-artifact.sh
jjb/kvmfornfv/kvmfornfv-upload-artifact.sh

index 89b7e31..1f99f17 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
 
 if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then
     JOB_TYPE=${BASH_REMATCH[0]}
index 190ab4b..48c0134 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
+set -o errexit
+set -o nounset
+set -o pipefail
 
 if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then
     JOB_TYPE=${BASH_REMATCH[0]}
@@ -11,6 +14,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 rm -r $GS_UPLOAD_LOCATION
         ;;
     daily)
         echo "Uploding daily artifacts This could take some time..."
@@ -22,7 +27,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