KVMFORNFV: Enable artifact download and testing for daily job 05/20105/4
authorkalyanreddy <reddyx.gundarapu@intel.com>
Thu, 1 Sep 2016 05:21:52 +0000 (10:51 +0530)
committerKalyan reddy Gundarapu <reddyx.gundarapu@intel.com>
Thu, 8 Sep 2016 10:43:01 +0000 (10:43 +0000)
This patch contains scripts for downloading artifacts and running
tests as part of KVM4NFV daily job.

Change-Id: Iaf557d260e236f873acf99d7d735c54d7d2903cf
Signed-off-by: kalyanreddy <reddyx.gundarapu@intel.com>
jjb/kvmfornfv/kvmfornfv-download-artifact.sh
jjb/kvmfornfv/kvmfornfv-test.sh
jjb/kvmfornfv/kvmfornfv.yml

index 1f99f17..c8bdb9c 100755 (executable)
@@ -16,6 +16,12 @@ case "$JOB_TYPE" in
         echo "Downloading artifacts for the change $GERRIT_CHANGE_NUMBER. This could take some time..."
         GS_UPLOAD_LOCATION="gs://artifacts.opnfv.org/$PROJECT/review/$GERRIT_CHANGE_NUMBER"
         ;;
+    daily)
+        gsutil cp gs://$GS_URL/latest.properties $WORKSPACE/latest.properties
+        source $WORKSPACE/latest.properties
+        GS_UPLOAD_LOCATION=$OPNFV_ARTIFACT_URL
+        echo "Downloading artifacts from $GS_UPLOAD_LOCATION for daily run. This could take some time..."
+        ;;
     *)
         echo "Artifact download is not enabled for $JOB_TYPE jobs"
         exit 1
index 868de13..06377ac 100755 (executable)
@@ -3,8 +3,24 @@
 ##This script includes executing cyclictest scripts.
 ##########################################################
 #The latest build packages are stored in build_output
+
 ls -al $WORKSPACE/build_output
 
-#start the test
-cd $WORKSPACE
-./ci/test_kvmfornfv.sh
+if [[ "$JOB_NAME" =~ (verify|merge|daily|weekly) ]]; then
+    JOB_TYPE=${BASH_REMATCH[0]}
+else
+    echo "Unable to determine job type!"
+    exit 1
+fi
+
+# do stuff differently based on the job type
+case "$JOB_TYPE" in
+    verify|daily)
+        #start the test
+        cd $WORKSPACE
+        ./ci/test_kvmfornfv.sh $JOB_TYPE
+        ;;
+    *)
+        echo "Test is not enabled for $JOB_TYPE jobs"
+        exit 1
+esac
index 4bb0a15..b6a55fe 100644 (file)
@@ -28,6 +28,7 @@
         - 'kvmfornfv-verify-{phase}-{stream}'
         - 'kvmfornfv-merge-{stream}'
         - 'kvmfornfv-daily-{stream}'
+        - 'kvmfornfv-daily-{phase}-{stream}'
 #####################################
 # job templates
 #####################################
          - timed: '@midnight'
 
     builders:
-        - shell:
-            !include-raw-escape: ./kvmfornfv-build.sh
-        - shell:
-            !include-raw-escape: ./kvmfornfv-upload-artifact.sh
+        - description-setter:
+            description: "Built on $NODE_NAME"
+        - multijob:
+            name: build
+            condition: SUCCESSFUL
+            projects:
+                - name: 'kvmfornfv-daily-build-{stream}'
+                  current-parameters: false
+                  node-parameters: false
+                  git-revision: true
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+        - multijob:
+            name: test
+            condition: SUCCESSFUL
+            projects:
+                - name: 'kvmfornfv-daily-test-{stream}'
+                  current-parameters: false
+                  node-parameters: false
+                  git-revision: true
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+
+
+- job-template:
+    name: 'kvmfornfv-daily-{phase}-{stream}'
+
+    disabled: '{obj:disabled}'
+
+    concurrent: false
+
+    scm:
+        - gerrit-trigger-scm:
+            credentials-id: '{ssh-credentials}'
+            refspec: ''
+            choosing-strategy: 'default'
+
+    wrappers:
+        - ssh-agent-credentials:
+            users:
+                - '{ssh-credentials}'
+        - timeout:
+            timeout: 360
+            fail: true
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+        - '{slave-label}-defaults'
+        - 'kvmfornfv-defaults':
+            gs-pathname: '{gs-pathname}'
+
+    builders:
+        - description-setter:
+            description: "Built on $NODE_NAME"
+        - '{project}-daily-{phase}-macro'
 #####################################
 # builder macros
 #####################################
             !include-raw: ./kvmfornfv-download-artifact.sh
         - shell:
             !include-raw: ./kvmfornfv-test.sh
+- builder:
+    name: 'kvmfornfv-daily-build-macro'
+    builders:
+        - shell:
+            !include-raw: ./kvmfornfv-build.sh
+        - shell:
+            !include-raw: ./kvmfornfv-upload-artifact.sh
+- builder:
+    name: 'kvmfornfv-daily-test-macro'
+    builders:
+        - shell:
+            !include-raw: ./kvmfornfv-download-artifact.sh
+        - shell:
+            !include-raw: ./kvmfornfv-test.sh
+
 #####################################
 # parameter macros
 #####################################