d72cefb33e2a549bd66f88eb79086fea5356bc19
[releng.git] / jjb / fuel / fuel-upload-artifact.sh
1 #!/bin/bash
2 set -o errexit
3 set -o nounset
4 set -o pipefail
5
6 # log info to console
7 echo "Uploading the $INSTALLER_TYPE artifact. This could take some time..."
8 echo "--------------------------------------------------------"
9 echo
10
11 # source the opnfv.properties to get ARTIFACT_VERSION
12 source $WORKSPACE/opnfv.properties
13
14 # upload artifact and additional files to google storage
15 gsutil cp $BUILD_DIRECTORY/opnfv-$OPNFV_ARTIFACT_VERSION.iso \
16     gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
17 gsutil cp $WORKSPACE/opnfv.properties \
18     gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
19 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
20     gsutil cp $WORKSPACE/opnfv.properties \
21     gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
22 elif [[ "$JOB_NAME" =~ "merge" ]]; then
23     echo "Uploaded Fuel ISO for a merged change"
24 fi
25
26 gsutil -m setmeta \
27     -h "Content-Type:text/html" \
28     -h "Cache-Control:private, max-age=0, no-transform" \
29     gs://$GS_URL/*.properties
30
31 gsutil -m setmeta \
32     -h "Cache-Control:private, max-age=0, no-transform" \
33     gs://$GS_URL/*.iso
34
35 echo
36 echo "--------------------------------------------------------"
37 echo "Done!"
38 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"