disable TestAPI update temporarily
[releng.git] / jjb / releng / testapi-automate.yml
index 25ee687..8f3ae0c 100644 (file)
@@ -4,24 +4,56 @@
         - master:
             branch: '{stream}'
             gs-pathname: ''
+
+    phase:
+        - 'docker-update'
+        - 'docker-deploy':
+            slave-label: 'testresults'
+        - 'generate-doc'
+
     jobs:
         - 'testapi-automate-{stream}'
+        - 'testapi-automate-{phase}-{stream}'
         - 'testapi-verify-{stream}'
 
     project: 'releng'
 
+- job:
+    name: 'testapi-mongodb-backup'
+
+    parameters:
+        - label:
+            name: SLAVE_LABEL
+            default: 'testresults'
+            description: 'Slave label on Jenkins'
+        - project-parameter:
+            project: 'releng'
+            branch: 'master'
+        - string:
+            name: GIT_BASE
+            default: https://gerrit.opnfv.org/gerrit/releng
+            description: 'Git URL to use on this Jenkins Slave'
+
+    scm:
+        - git-scm
+
+    triggers:
+        - timed: '@weekly'
+
+    builders:
+        - mongodb-backup
+
 - job-template:
     name: 'testapi-verify-{stream}'
 
     parameters:
         - project-parameter:
             project: '{project}'
-        - gerrit-parameter:
             branch: '{branch}'
         - 'opnfv-build-ubuntu-defaults'
 
     scm:
-        - git-scm
+        - git-scm-gerrit
 
     triggers:
         - gerrit:
@@ -44,7 +76,7 @@
                     branch-pattern: '**/{branch}'
                 file-paths:
                   - compare-type: 'ANT'
-                    pattern: 'utils/**'
+                    pattern: 'utils/test/testapi/**'
 
     builders:
         - run-unit-tests
@@ -55,8 +87,8 @@
         - cobertura:
             report-file: "coverage.xml"
             only-stable: "true"
-            health-auto-update: "true"
-            stability-auto-update: "true"
+            health-auto-update: "false"
+            stability-auto-update: "false"
             zoom-coverage-chart: "true"
             targets:
                 - files:
 - job-template:
     name: 'testapi-automate-{stream}'
 
+    project-type: multijob
+
+    properties:
+        - throttle:
+            enabled: true
+            max-total: 1
+            max-per-node: 1
+            option: 'project'
+
     parameters:
         - project-parameter:
             project: '{project}'
-        - gerrit-parameter:
             branch: '{branch}'
         - string:
             name: DOCKER_TAG
     scm:
         - git-scm
 
+    wrappers:
+        - ssh-agent-wrapper
+        - timeout:
+            timeout: 360
+            fail: true
+
     triggers:
         - gerrit:
             server-name: 'gerrit.opnfv.org'
                     branch-pattern: '**/{branch}'
                 file-paths:
                   - compare-type: 'ANT'
-                    pattern: 'utils/**'
+                    pattern: 'utils/test/testapi/**'
+
+    builders:
+        - description-setter:
+            description: "Built on $NODE_NAME"
+        - multijob:
+            name: docker-update
+            condition: SUCCESSFUL
+            projects:
+                - name: 'testapi-automate-docker-update-{stream}'
+                  current-parameters: true
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+        - multijob:
+            name: docker-deploy
+            condition: SUCCESSFUL
+            projects:
+                - name: 'testapi-automate-docker-deploy-{stream}'
+                  current-parameters: false
+                  predefined-parameters: |
+                    GIT_BASE=$GIT_BASE
+                  node-label-name: SLAVE_LABEL
+                  node-label: testresults
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+        - multijob:
+            name: generate-doc
+            condition: SUCCESSFUL
+            projects:
+                - name: 'testapi-automate-generate-doc-{stream}'
+                  current-parameters: true
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+
+    publishers:
+        - 'email-publisher'
+
+- job-template:
+    name: 'testapi-automate-{phase}-{stream}'
+
+    properties:
+        - throttle:
+            enabled: true
+            max-per-node: 1
+            option: 'project'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+            branch: '{branch}'
+        - string:
+            name: DOCKER_TAG
+            default: "latest"
+            description: "Tag name for testapi docker image"
+
+    wrappers:
+        - ssh-agent-wrapper
+        - timeout:
+            timeout: 120
+            fail: true
+
+    scm:
+        - git-scm
 
     builders:
-        - docker-update
-        - start-testapi-server
-        - testapi-doc-build
-        - upload-doc-artifact
-        - clean-testapi-server
+        - description-setter:
+            description: "Built on $NODE_NAME"
+        - 'testapi-automate-{phase}-macro'
 
 ################################
 # job builders
 ################################
+- builder:
+    name: mongodb-backup
+    builders:
+        - shell: |
+            bash ./jjb/releng/testapi-backup-mongodb.sh
 
 - builder:
-    name: run-unit-tests
+    name: 'run-unit-tests'
     builders:
         - shell: |
             bash ./utils/test/testapi/run_test.sh
 
 - builder:
-    name: docker-update
+    name: 'testapi-automate-docker-update-macro'
     builders:
         - shell: |
             bash ./jjb/releng/testapi-docker-update.sh
 
 - builder:
-    name: start-testapi-server
+    name: 'testapi-automate-generate-doc-macro'
     builders:
-        - shell: |
-            bash ./utils/test/testapi/htmlize/prepare.sh
+        - 'testapi-doc-build'
+        - 'upload-doc-artifact'
 
 - builder:
-    name: testapi-doc-build
+    name: 'testapi-doc-build'
     builders:
         - shell: |
             bash ./utils/test/testapi/htmlize/doc-build.sh
 
 - builder:
-    name: upload-doc-artifact
+    name: 'upload-doc-artifact'
     builders:
         - shell: |
             bash ./utils/test/testapi/htmlize/push-doc-artifact.sh
 
 - builder:
-    name: clean-testapi-server
+    name: 'testapi-automate-docker-deploy-macro'
     builders:
         - shell: |
-            bash ./utils/test/testapi/htmlize/finish.sh
+            echo 'disable TestAPI update temporarily due to frequent change'
+#            bash ./jjb/releng/testapi-docker-deploy.sh
+
+################################
+# job publishers
+################################
+
+- publisher:
+    name: 'email-publisher'
+    publishers:
+        - email:
+            recipients: rohitsakala@gmail.com feng.xiaowei@zte.com.cn
+            notify-every-unstable-build: false
+            send-to-individuals: true