6 APEX_PKGS="common undercloud onos"
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..."
29 echo "Downloading latest properties file"
31 # get the properties file in order to get info regarding artifacts
32 curl --fail -s -o $BUILD_DIRECTORY/opnfv.properties http://$GS_URL/latest.properties
34 # source the file so we get OPNFV vars
35 source $BUILD_DIRECTORY/opnfv.properties
37 RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//')
38 RPM_LIST=${RPM_INSTALL_PATH}/$(basename $OPNFV_RPM_URL)
41 VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
42 # build RPM List which already includes base Apex RPM
43 for pkg in ${APEX_PKGS}; do
44 RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}.noarch.rpm"
47 # remove old / install new RPMs
48 if rpm -q opnfv-apex > /dev/null; then
49 INSTALLED_RPMS=$(rpm -qa | grep apex)
50 if [ -n "$INSTALLED_RPMS" ]; then
51 sudo yum remove -y ${INSTALLED_RPMS}
54 if ! sudo yum install -y $RPM_LIST; then
55 echo "Unable to install new RPMs: $RPM_LIST"
60 # TODO: Uncomment these lines to verify SHA512SUMs once the sums are
62 # echo "$OPNFV_ARTIFACT_SHA512SUM $BUILD_DIRECTORY/apex.iso" | sha512sum -c
63 # echo "$OPNFV_RPM_SHA512SUM $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)" | sha512sum -c
66 ls -al $BUILD_DIRECTORY
69 echo "--------------------------------------------------------"