Apex: fix unbound variable in artifact dl 45/57845/1
authorTim Rozet <trozet@redhat.com>
Thu, 24 May 2018 18:17:00 +0000 (14:17 -0400)
committerTim Rozet <trozet@redhat.com>
Thu, 24 May 2018 18:17:00 +0000 (14:17 -0400)
We still need VERSION_EXTENSION var to figure out which RPM files to
remove on the slave.

Change-Id: I03cc9c3318edec9860c8f3ffc01db52517a644b4
Signed-off-by: Tim Rozet <trozet@redhat.com>
jjb/apex/apex-download-artifact.sh

index 3efe1cb..e1e51b3 100755 (executable)
@@ -45,10 +45,9 @@ else
 
   RPM_INSTALL_PATH=$(echo "http://"$OPNFV_RPM_URL | sed 's/\/'"$(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]+)')
   if [ "$BRANCH" != 'master' ]; then
-    # 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+=" opnfv-apex-undercloud-${VERSION_EXTENSION}.noarch.rpm"
     RPM_LIST+=" python34-opnfv-apex-${VERSION_EXTENSION}.noarch.rpm"