2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
14 # disable Fuel ISO download for master branch
15 [[ "$BRANCH" == 'master' ]] && exit 0
17 echo "Host info: $(hostname) $(hostname -I)"
19 # Configurable environment variables:
20 # ISOSTORE (/iso_mount/opnfv_ci)
22 if [[ "$JOB_NAME" =~ "merge" ]]; then
23 echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties"
24 # get the properties file for the Armband Fuel ISO built for a merged change
25 curl -f -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties
27 # get the latest.properties file in order to get info regarding latest artifact
28 echo "Downloading http://$GS_URL/latest.properties"
29 curl -f -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
32 # source the file so we get artifact metadata, it will exit if it doesn't exist
33 source latest.properties
35 # echo the info about artifact that is used during the deployment
36 OPNFV_ARTIFACT=${OPNFV_ARTIFACT_URL/*\/}
37 echo "Using $OPNFV_ARTIFACT for deployment"
39 # Releng doesn't want us to use anything but opnfv.iso for now. We comply.
40 ISO_FILE=${WORKSPACE}/opnfv.iso
42 # using ISOs for verify & merge jobs from local storage will be enabled later
43 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
44 # check if we already have the ISO to avoid redownload
45 ISOSTORE=${ISOSTORE:-/iso_mount/opnfv_ci}/${BRANCH##*/}
46 if [[ -f "$ISOSTORE/$OPNFV_ARTIFACT" ]]; then
47 echo "ISO exists locally. Skipping the download and using the file from ISO store"
48 ln -s $ISOSTORE/$OPNFV_ARTIFACT ${ISO_FILE}
49 echo "--------------------------------------------------------"
53 echo "--------------------------------------------------------"
59 # Use gsutils if available
60 if $(which gsutil &>/dev/null); then
61 DOWNLOAD_URL="gs://$OPNFV_ARTIFACT_URL"
62 CMD="gsutil cp ${DOWNLOAD_URL} ${ISO_FILE}"
65 # -f returns error if the file was not found or on server error
66 DOWNLOAD_URL="http://$OPNFV_ARTIFACT_URL"
67 CMD="curl -f -s -o ${ISO_FILE} ${DOWNLOAD_URL}"
71 echo "Downloading the $INSTALLER_TYPE artifact using URL $DOWNLOAD_URL"
72 echo "This could take some time..."
73 echo "--------------------------------------------------------"
76 echo "--------------------------------------------------------"