summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-09-01 00:18:15 -0400
committerTim Rozet <trozet@redhat.com>2017-09-01 00:18:15 -0400
commit2dbeceafaf72fa94e1c4c928bf3b38b5690273cf (patch)
tree7f3de11de5f62cb39e4d1e9aa60bbcbfeb9e7be0 /jjb
parent2efecc1438fdaed8aa7e9f4eb4c4b42b4fbef1fc (diff)
Apex: fixes always downloading RPMs in daily deploy
Change-Id: I30bc270c1ae9c648ec184e446a712bd304ad1230 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'jjb')
-rwxr-xr-xjjb/apex/apex-download-artifact.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/jjb/apex/apex-download-artifact.sh b/jjb/apex/apex-download-artifact.sh
index 860cd60a5..7293e8243 100755
--- a/jjb/apex/apex-download-artifact.sh
+++ b/jjb/apex/apex-download-artifact.sh
@@ -21,7 +21,7 @@ if [[ "$ARTIFACT_VERSION" =~ dev ]]; then
tar -xvf apex-${OPNFV_ARTIFACT_VERSION}.tar.gz
popd > /dev/null
else
- echo "Will download RPMs..."
+ echo "Will use RPMs..."
# Must be RPMs/ISO
echo "Downloading latest properties file"
@@ -33,13 +33,13 @@ else
source $BUILD_DIRECTORY/opnfv.properties
RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(basename $OPNFV_RPM_URL)"'//')
- RPM_LIST=${RPM_INSTALL_PATH}/$(basename $OPNFV_RPM_URL)
+ RPM_LIST=$(basename $OPNFV_RPM_URL)
# find version of RPM
VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-([0-9]{8}|[a-z]+-[0-9]\.[0-9]+)')
# build RPM List which already includes base Apex RPM
- RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
- RPM_LIST+=" ${RPM_INSTALL_PATH}/python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"
+ RPM_LIST+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
+ RPM_LIST+=" python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"
# remove old / install new RPMs
if rpm -q opnfv-apex > /dev/null; then
@@ -48,10 +48,20 @@ else
sudo yum remove -y ${INSTALLED_RPMS}
fi
fi
+ # Create an rpms dir on slave
+ mkdir -p ~/apex_rpms
+ pushd ~/apex_rpms
+ # Remove older rpms which do not match this version
+ find . ! -name *${VERSION_EXTENSION}.noarch.rpm -type f -exec rm -f {} +
+ # Download RPM only if changed on server
+ for rpm in $RPM_LIST; do
+ wget -N ${RPM_INSTALL_PATH}/${rpm}
+ done
if ! sudo yum install -y $RPM_LIST; then
echo "Unable to install new RPMs: $RPM_LIST"
exit 1
fi
+ popd
fi
# TODO: Uncomment these lines to verify SHA512SUMs once the sums are