Merge "joid: correct keystone ip fetch for noha mode - correct admin-password"
[releng.git] / jjb / fuel / fuel-download-artifact.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 if [[ "$JOB_NAME" =~ "merge" ]]; then
15     echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties"
16     # get the properties file for the Fuel ISO built for a merged change
17     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties
18 else
19     # get the latest.properties file in order to get info regarding latest artifact
20     echo "Downloading http://$GS_URL/latest.properties"
21     curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
22 fi
23
24 # check if we got the file
25 [[ -f latest.properties ]] || exit 1
26
27 # source the file so we get artifact metadata
28 source latest.properties
29
30 # echo the info about artifact that is used during the deployment
31 OPNFV_ARTIFACT=${OPNFV_ARTIFACT_URL/*\/}
32 echo "Using $OPNFV_ARTIFACT for deployment"
33
34 # check if we already have the ISO to avoid redownload
35 # disabled for the timebeing - needs adjustments
36 #ISO_STORE=$HOME/opnfv/iso_store/fuel
37 #if [[ -f "$ISO_STORE/$OPNFV_ARTIFACT" ]]; then
38 #    echo "ISO already exists. Skipping the download"
39 #    ln -s $ISO_STORE/$OPNFV_ARTIFACT $WORKSPACE/opnfv.iso
40 #    ls -al $WORKSPACE/opnfv.iso
41 #    exit 0
42 #fi
43
44 # log info to console
45 echo "Downloading the $INSTALLER_TYPE artifact using URL http://$OPNFV_ARTIFACT_URL"
46 echo "This could take some time..."
47 echo "--------------------------------------------------------"
48 echo
49
50 # download the file
51 curl -s -o $WORKSPACE/opnfv.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
52
53 # list the file
54 ls -al $WORKSPACE/opnfv.iso
55
56 echo
57 echo "--------------------------------------------------------"
58 echo "Done!"