Added Builder to push results to DB for Qtip JJB 43/6843/3
authorNauman_Ahad <Nauman_Ahad@dell.com>
Fri, 15 Jan 2016 13:48:46 +0000 (18:48 +0500)
committerNauman_Ahad <Nauman_Ahad@dell.com>
Mon, 18 Jan 2016 14:18:38 +0000 (19:18 +0500)
Added a builder to push QTIP results to Central Result Collection DB after a Qtip run.
Builder calls a script within the docker container to push available results to DB.
If no results are available, nothing is pushed

Change-Id: I0ae4dada0efd4e04b4a5cf9026e3dbcf99c4cccf
Signed-off-by: Nauman_Ahad <Nauman_Ahad@dell.com>
jjb/qtip/qtip.yml

index 9c627b8..450ba93 100644 (file)
         - 'qtip-cleanup'
         - 'qtip-set-env'
         - 'qtip-run-suite'
+        - 'qtip-pushtoDB'
 
     triggers:
       - timed: '0 0,13,15,20 * * *'
     builders:
         - shell: |
             #!/bin/bash
-            echo "The container id is:"
             container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
-            echo $container_id
-            QTIP_REPO=/home/opnfv/repos/qtip
-            docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
+            if [[ ! -z ${container_id} ]]; then
+                echo "The container ID is: ${container_id}"
+                QTIP_REPO=/home/opnfv/repos/qtip
+                docker exec -t ${container_id} $QTIP_REPO/docker/run_qtip.sh
+            else
+                echo "Container ID not available"
+            fi
+
+- builder:
+    name: qtip-pushtoDB
+    builders:
+        - shell: |
+            #!/bin/bash
 
+            echo "Pushing available results to DB"
+            echo "The container id is:"
+            container_id=$(docker ps | grep 'opnfv/qtip:latest' | awk '{print $1}' | head -1)
+            if [[ ! -z ${container_id} ]]; then
+                echo "The condiner ID is: ${container_id}"
+                QTIP_REPO=/home/opnfv/repos/qtip
+                docker exec -t ${container_id} $QTIP_REPO/docker/push_db.sh
+            else
+                echo "Container ID not available"
+            fi
 
 - builder:
     name: qtip-cleanup