5 if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then
6 JOB_TYPE=${BASH_REMATCH[0]}
8 echo "Unable to determine job type!"
14 echo "Uploading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..."
15 GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
16 echo "Removing artifacts produced for the previous patch for the change $GERRIT_CHANGE_NUMBER"
17 gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1 && gsutil rm -r $GS_UPLOAD_LOCATION
20 echo "Uploding daily artifacts This could take some time..."
21 OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
22 GS_UPLOAD_LOCATION="gs://$GS_URL/$OPNFV_ARTIFACT_VERSION"
25 echo "Artifact upload is not enabled for $JOB_TYPE jobs"
29 gsutil cp -r $WORKSPACE/build_output/* $GS_UPLOAD_LOCATION > $WORKSPACE/gsutil.log 2>&1
30 gsutil -m setmeta -r \
31 -h "Cache-Control:private, max-age=0, no-transform" \
32 $GS_UPLOAD_LOCATION > /dev/null 2>&1
34 gsutil ls $GS_UPLOAD_LOCATION > /dev/null 2>&1
35 if [[ $? -ne 0 ]]; then
36 echo "Problem while uploading artifacts!"
37 echo "Check log $WORKSPACE/gsutil.log on $NODE_NAME"
40 echo "Uploaded artifacts!"