Merge "bottlenecks: rewrite bottlenecks jobs into parent/son for supporting of differ...
authorMatthewLi <matthew.lijun@huawei.com>
Fri, 15 Jan 2016 05:57:15 +0000 (05:57 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Fri, 15 Jan 2016 05:57:15 +0000 (05:57 +0000)
jjb/apex/apex.yml
jjb/compass4nfv/compass-project-jobs.yml

index e6d196a..57825ce 100644 (file)
 
             source opnfv.properties
             RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
+            if [ ! -e "$RPM_INSTALL_PATH" ]; then
+               RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
+            fi
+
+            RPM_LIST=$RPM_INSTALL_PATH
+            for pkg in common undercloud; do
+                RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
+            done
 
             # update / install the new rpm
             if rpm -q opnfv-apex > /dev/null; then
                if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
                  echo "RPM is already installed"
-               elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
-                   sudo yum downgrade -y $RPM_INSTALL_PATH;
+               elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
+                   if ! sudo yum downgrade -y $RPM_LIST; then
+                     yum remove -y opnfv-undercloud opnfv-common
+                     sudo yum downgrade -y $RPM_INSTALL_PATH
+                   fi
                fi
             else
-               sudo yum install -y $RPM_INSTALL_PATH;
+               sudo yum install -y $RPM_LIST;
             fi
 
             # cleanup virtual machines before we start
                RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
             fi
 
+            RPM_LIST=$RPM_INSTALL_PATH
+            for pkg in common undercloud; do
+                RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
+            done
+
             # update / install the new rpm
             if rpm -q opnfv-apex > /dev/null; then
                if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
                  echo "RPM is already installed"
-               elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
-                   sudo yum downgrade -y $RPM_INSTALL_PATH;
+               elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
+                   if ! sudo yum downgrade -y $RPM_LIST; then
+                     yum remove -y opnfv-undercloud opnfv-common
+                     sudo yum downgrade -y $RPM_INSTALL_PATH
+                   fi
                fi
             else
-               sudo yum install -y $RPM_INSTALL_PATH;
+               sudo yum install -y $RPM_LIST;
             fi
 
             # cleanup environment before we start
index 8c781f3..345c4c3 100644 (file)
@@ -66,7 +66,7 @@
         - '{installer}-defaults'
         - string:
             name: SDN_CONTROLLER
-            default: '{sdn-controller}'
+            default: 'nosdn'
 
     scm:
         - gerrit-trigger-scm: