summaryrefslogtreecommitdiffstats
path: root/jjb/compass4nfv/compass-download-artifact.sh
blob: f8915643fd727116d688b573b369a972709f94ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail

# log info to console
echo "Downloading the $INSTALLER_TYPE artifact. This could take some time..."
echo "--------------------------------------------------------"
echo

# get the latest.properties file in order to get info regarding latest artifact
[[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
curl -s -o $BUILD_DIRECTORY/latest.properties http://$GS_URL/latest.properties

# check if we got the file
[[ -f $BUILD_DIRECTORY/latest.properties ]] || exit 1

# source the file so we get OPNFV vars
source $BUILD_DIRECTORY/latest.properties

if [[ "$BRANCH" == 'stable/danube' ]]; then
    # download the file
    curl -s -o $BUILD_DIRECTORY/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
    # list the file
    ls -al $BUILD_DIRECTORY/compass.iso
else
    # download the file
    curl -s -o $BUILD_DIRECTORY/compass.tar.gz http://$OPNFV_ARTIFACT_URL > gsutil.tar.gz.log 2>&1
    # list the file
    ls -al $BUILD_DIRECTORY/compass.tar.gz
fi

echo
echo "--------------------------------------------------------"
echo "Done!"