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