Merge "upload ppa and corresponding md5 at the same time"
authorJun Li <matthew.lijun@huawei.com>
Tue, 27 Oct 2015 23:46:10 +0000 (23:46 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 27 Oct 2015 23:46:10 +0000 (23:46 +0000)
jjb/apex/apex.yml
jjb/functest/functest.yml

index 7a79a37..3893478 100644 (file)
@@ -76,6 +76,7 @@
 
     builders:
         - 'apex-build'
+        - 'apex-deploy-virtual'
         - 'apex-workspace-cleanup'
 
 - job-template:
 
     builders:
         - 'apex-build'
+        - 'apex-deploy-virtual'
         - 'apex-workspace-cleanup'
 
 - job-template:
         - 'apex-build'
         - 'apex-upload-artifact'
         - 'apex-workspace-cleanup'
+        - 'apex-deploy-virtual'
+        - 'apex-workspace-cleanup'
 
 ########################
 # parameter macros
             echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
             echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
 
+- builder:
+    name: 'apex-deploy-virtual'
+    builders:
+        - shell: |
+            #!/bin/bash
+            set -o errexit
+            set -o nounset
+            set -o pipefail
+
+            # log info to console
+            echo "Starting the Apex virtual deployment."
+            echo "--------------------------------------------------------"
+            echo
+
+            # check if we got the file
+            if [[ -f opnfv.properties ]]; then
+                # source the file so we get OPNFV vars
+                source opnfv.properties
+                RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
+            else
+                # get the latest.properties file in order to get info regarding latest artifact
+                curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
+                [[ -f opnfv.properties ]] || exit 1
+
+                # source the file so we get OPNFV vars
+                source opnfv.properties
+                RPM_INSTALL_PATH=$RPM_URL
+            fi
+
+            # update / install the new rpm
+            if rpm -q opnfv-apex; then
+               sudo yum update -y $RPM_INSTALL_PATH;
+            else
+               sudo yum install -y $RPM_INSTALL_PATH;
+            fi
+
+            # cleanup virtual machines before we start
+            sudo opnfv-clean
+            # initiate virtual deployment
+            sudo opnfv-deploy -v
+
+            echo
+            echo "--------------------------------------------------------"
+            echo "Done!"
 
 #######################
 # trigger macros
index efd6245..d80cfae 100644 (file)
         artifactNumToKeep: -1
 
     builders:
+        - 'set-functest-env'
         - 'functest-all'
         - 'functest-store-results'
         - 'functest-cleanup'
         artifactNumToKeep: -1
 
     builders:
+        - 'set-functest-env'
         - 'functest-all'
         - 'functest-store-results'
         - 'functest-cleanup'
             #!/bin/bash
             set +e
 
-            # Remove any docker containers leftovers
-            docker ps | grep opnfv/functest | awk '{print $1}' | xargs docker stop &>/dev/null
-            docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm &>/dev/null
-            docker images | grep opnfv/functest | awk '{print $3}' | xargs docker rmi &>/dev/null
-
-            # Pull and store fresh image from Dockerhub
-            docker pull opnfv/functest
-
-            # Run Docker and Functest tests
-            cmd="${FUNCTEST_REPO_DIR}/docker/start.sh"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            echo "Functest: running all the tests"
+            cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh"
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd
 
 
 - builder:
             #!/bin/bash
             set +e
 
-            echo "Functest: spawn Docker and run Functest suite"
-            cmd="${FUNCTEST_REPO_DIR}/docker/start.sh"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-            -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            echo "Functest: Start Docker and prepare environment"
+            envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}"
+            docker ps -a | grep opnfv/functest | awk '{print $1}' | xargs docker rm -f &>/dev/null
+            docker pull opnfv/functest
+            echo "Functest: Running docker run command: docker run -i -e $envs opnfv/functest /bin/bash &"
+            docker run -i -e $envs opnfv/functest /bin/bash &
+            docker ps -a
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            echo "Container ID=${container_id}"
+            if [ -z ${container_id} ]; then
+                echo "Cannot find opnfv/functest container ID. Please check if it is existing."
+                docker ps -a
+                exit 1
+            fi
+            docker start $container_id
+            cmd="${FUNCTEST_REPO_DIR}/docker/prepare_env.sh"
+            docker exec $container_id $cmd
 
 
 - builder:
             set +e
 
             echo "Functest: run vPing"
-            cmd="python ${FUNCTEST_REPO_DIR}/testcases/vPing/CI/libraries/vPing.py \
-                --debug ${FUNCTEST_REPO_DIR}/ -r"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test vping"
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd
 
 - builder:
     name: functest-odl
             set +e
 
             echo "Functest: run ODL suite"
-            cmd="${FUNCTEST_REPO_DIR}/testcases/Controllers/ODL/CI/start_tests.sh"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test odl"
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd
 
 - builder:
     name: functest-tempest-smoke
 
             # tempest
             echo "Functest: run Tempest suite"
-            cmd="rally verify start smoke; rally verify list;"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test tempest"
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd
 
 
 
             set +e
 
             echo "Functest: run Functest Rally Bench suites"
-            cmd="python ${FUNCTEST_REPO_DIR}/testcases/VIM/OpenStack/CI/libraries/run_rally.py \
-                --debug ${FUNCTEST_REPO_DIR}/ all"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            cmd="${FUNCTEST_REPO_DIR}/docker/run_tests.sh --test rally"
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd
 
 
 - builder:
             set +e
             cmd="python ${FUNCTEST_REPO_DIR}/testcases/vIMS/CI/vIMS.py \
                 --debug ${FUNCTEST_REPO_DIR}/"
-            docker run -t -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
-                -e "INSTALLER_IP=${INSTALLER_IP}" opnfv/functest $cmd
+            container_id=$(docker ps -a | grep opnfv/functest | awk '{print $1}' | head -1)
+            docker exec $container_id $cmd