6 APEX_PKGS="common undercloud" # removed onos for danube
9 echo "Downloading the Apex artifact. This could take some time..."
10 echo "--------------------------------------------------------"
13 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
15 if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
17 GERRIT_PATCHSET_NUMBER=$(echo $GERRIT_REFSPEC | grep -Eo '[0-9]+$')
18 export OPNFV_ARTIFACT_VERSION="dev${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}"
20 pushd ${BUILD_DIRECTORY} > /dev/null
21 echo "Downloading packaged dev build: apex-${OPNFV_ARTIFACT_VERSION}.tar.gz"
22 curl --fail -s -o $BUILD_DIRECTORY/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz http://$GS_URL/apex-${OPNFV_ARTIFACT_VERSION}.tar.gz
23 tar -xvf apex-${OPNFV_ARTIFACT_VERSION}.tar.gz
26 echo "Will download RPMs and ISO..."
29 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
30 echo "Downloading opnfv-${OPNFV_ARTIFACT_VERSION}.properties"
32 # get the properties file in order to get info regarding artifacts
33 curl --fail -s -o $BUILD_DIRECTORY/opnfv.properties http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties
35 # source the file so we get OPNFV vars
36 source $BUILD_DIRECTORY/opnfv.properties
38 RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//')
39 RPM_LIST=${RPM_INSTALL_PATH}/$(basename $OPNFV_RPM_URL)
42 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
43 # build RPM List which already includes base Apex RPM
44 for pkg in ${APEX_PKGS}; do
45 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}.noarch.rpm"
48 # remove old / install new RPMs
49 if rpm -q opnfv-apex > /dev/null; then
50 INSTALLED_RPMS=$(rpm -qa | grep apex)
51 if [ -n "$INSTALLED_RPMS" ]; then
52 sudo yum remove -y ${INSTALLED_RPMS}
55 if ! sudo yum install -y $RPM_LIST; then
56 echo "Unable to install new RPMs: $RPM_LIST"
61 echo "Downloading the ISO artifact using URL http://$OPNFV_ARTIFACT_URL"
62 echo "--------------------------------------------------------"
66 curl --fail -s -o $BUILD_DIRECTORY/apex.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
70 # TODO: Uncomment these lines to verify SHA512SUMs once the sums are
72 # echo "$OPNFV_ARTIFACT_SHA512SUM $BUILD_DIRECTORY/apex.iso" | sha512sum -c
73 # echo "$OPNFV_RPM_SHA512SUM $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)" | sha512sum -c
76 ls -al $BUILD_DIRECTORY
79 echo "--------------------------------------------------------"