79f411994e262964e4dbd5d584201a0219a2c644
[releng.git] / jjb / fuel / fuel-download-artifact.sh
1 #!/bin/bash
2 set -o errexit
3 set -o nounset
4 set -o pipefail
5
6 if [[ "$JOB_NAME" =~ "merge" ]]; then
7     # get the properties file for the Fuel ISO built for a merged change
8     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties
9 else
10     # get the latest.properties file in order to get info regarding latest artifact
11     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
12 fi
13
14 # check if we got the file
15 [[ -f latest.properties ]] || exit 1
16
17 # source the file so we get OPNFV vars
18 source latest.properties
19
20 # log info to console
21 echo "Downloading the $INSTALLER_TYPE artifact using URL http://$OPNFV_ARTIFACT_URL"
22 echo "This could take some time..."
23 echo "--------------------------------------------------------"
24 echo
25
26 # download the file
27 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
28
29 # list the file
30 ls -al $WORKSPACE/opnfv.iso
31
32 echo
33 echo "--------------------------------------------------------"
34 echo "Done!"