fuel: Disable use of local ISO and trigger of merge virtual deploy jobs
[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     echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties"
8     # get the properties file for the Fuel ISO built for a merged change
9     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties
10 else
11     # get the latest.properties file in order to get info regarding latest artifact
12     echo "Downloading http://$GS_URL/latest.properties"
13     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
14 fi
15
16 # check if we got the file
17 [[ -f latest.properties ]] || exit 1
18
19 # source the file so we get artifact metadata
20 source latest.properties
21
22 # echo the info about artifact that is used during the deployment
23 OPNFV_ARTIFACT=${OPNFV_ARTIFACT_URL/*\/}
24 echo "Using $OPNFV_ARTIFACT for deployment"
25
26 # check if we already have the ISO to avoid redownload
27 # disabled for the timebeing - needs adjustments
28 #ISO_STORE=$HOME/opnfv/iso_store/fuel
29 #if [[ -f "$ISO_STORE/$OPNFV_ARTIFACT" ]]; then
30 #    echo "ISO already exists. Skipping the download"
31 #    ln -s $ISO_STORE/$OPNFV_ARTIFACT $WORKSPACE/opnfv.iso
32 #    ls -al $WORKSPACE/opnfv.iso
33 #    exit 0
34 #fi
35
36 # log info to console
37 echo "Downloading the $INSTALLER_TYPE artifact using URL http://$OPNFV_ARTIFACT_URL"
38 echo "This could take some time..."
39 echo "--------------------------------------------------------"
40 echo
41
42 # download the file
43 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
44
45 # list the file
46 ls -al $WORKSPACE/opnfv.iso
47
48 echo
49 echo "--------------------------------------------------------"
50 echo "Done!"