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 ##############################################################################
13 echo "Host info: $(hostname) $(hostname -I)"
15 # Configurable environment variables:
16 # ISOSTORE (/iso_mount/opnfv_ci)
18 if [[ "$JOB_NAME" =~ "merge" ]]; then
19 echo "Downloading http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties"
20 # get the properties file for the Armband Fuel ISO built for a merged change
21 curl -f -s -o $WORKSPACE/latest.properties http://$GS_URL/opnfv-gerrit-$GERRIT_CHANGE_NUMBER.properties
23 # get the latest.properties file in order to get info regarding latest artifact
24 echo "Downloading http://$GS_URL/latest.properties"
25 curl -f -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
28 # source the file so we get artifact metadata, it will exit if it doesn't exist
29 source latest.properties
31 # echo the info about artifact that is used during the deployment
32 OPNFV_ARTIFACT=${OPNFV_ARTIFACT_URL/*\/}
33 echo "Using $OPNFV_ARTIFACT for deployment"
35 # Releng doesn't want us to use anything but opnfv.iso for now. We comply.
36 ISO_FILE=${WORKSPACE}/opnfv.iso
38 # using ISOs for verify & merge jobs from local storage will be enabled later
39 if [[ ! "$JOB_NAME" =~ (verify|merge) ]]; then
40 # check if we already have the ISO to avoid redownload
41 ISOSTORE=${ISOSTORE:-/iso_mount/opnfv_ci}/${GIT_BRANCH##*/}
42 if [[ -f "$ISOSTORE/$OPNFV_ARTIFACT" ]]; then
43 echo "ISO exists locally. Skipping the download and using the file from ISO store"
44 ln -s $ISOSTORE/$OPNFV_ARTIFACT ${ISO_FILE}
45 echo "--------------------------------------------------------"
49 echo "--------------------------------------------------------"
55 # Use gsutils if available
56 if $(which gsutil &>/dev/null); then
57 DOWNLOAD_URL="gs://$OPNFV_ARTIFACT_URL"
58 CMD="gsutil cp ${DOWNLOAD_URL} ${ISO_FILE}"
61 # -f returns error if the file was not found or on server error
62 DOWNLOAD_URL="http://$OPNFV_ARTIFACT_URL"
63 CMD="curl -f -s -o ${ISO_FILE} ${DOWNLOAD_URL}"
67 echo "Downloading the $INSTALLER_TYPE artifact using URL $DOWNLOAD_URL"
68 echo "This could take some time..."
69 echo "--------------------------------------------------------"
72 echo "--------------------------------------------------------"