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