3rd party ci: Create job to bring up apex vms 43/25843/3
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Tue, 13 Dec 2016 10:32:12 +0000 (11:32 +0100)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Tue, 13 Dec 2016 11:12:39 +0000 (12:12 +0100)
This is a temporary fix in order to continue with the netvirt parts.
Once Apex team finishes their work with APEX-360, this job will be
aligned with it.

The job to bring up apex vms will be run on ericsson-virtual5.
The rest of the jobs will run on ericsson-virtual6, which is virtual
jumphost for the apex environment.

Apart from this, the job can now be (re)triggered by putting keyword
opnfv-test on ODL Gerrit.

There are still flaws and things to improve with the jobs such as
finding out if the downloaded artifact is real or just a file not found
response from ODL Jenkins and so on but these will be fixed later.

Change-Id: Ie38e513df08c6c76eacee53a112c09171b1f6c7d
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/3rd_party_ci/create-apex-vms.sh [new file with mode: 0755]
jjb/3rd_party_ci/install-netvirt.sh
jjb/3rd_party_ci/odl-netvirt.yml
jjb/global/slave-params.yml

diff --git a/jjb/3rd_party_ci/create-apex-vms.sh b/jjb/3rd_party_ci/create-apex-vms.sh
new file mode 100755 (executable)
index 0000000..cb74271
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# clone opnfv sdnvpn repo
+git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git
+cd sdnvpn
+ls -al
+
+# here is where the script(s) to bring up apex vms should be executed
index c24e890..041d851 100755 (executable)
@@ -1,4 +1,8 @@
 #!/bin/bash
 
-echo "Using the downloaded artifact to install netvirt"
-ls -al $NETVIRT_ARTIFACT
+# clone opnfv sdnvpn repo
+git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git
+cd sdnvpn
+ls -al
+
+# here is where the script(s) to install netvirt should be executed
index d44fc36..54d1e43 100644 (file)
 # patch verification phases
 #####################################
     phase:
-        - 'install'
-        - 'functest'
-        - 'postprocess'
+        - 'create-apex-vms':
+            slave-label: 'ericsson-virtual5'
+        - 'install-netvirt':
+            slave-label: 'ericsson-virtual6'
+        - 'functest':
+            slave-label: 'ericsson-virtual6'
+        - 'postprocess':
+            slave-label: 'ericsson-virtual6'
 #####################################
 # jobs
 #####################################
         - string:
             name: NETVIRT_ARTIFACT
             default: $WORKSPACE/distribution-karaf.tar.gz"
-        - 'odl-netvirt-virtual-defaults'
+        - 'ericsson-virtual6-defaults'
 
     scm:
-        #- git:
-        #    url: 'https://git.opendaylight.org/gerrit/p/$PROJECT.git'
-        #    refspec: '$GERRIT_REFSPEC'
-        #    branches:
-        #        - 'origin/$GERRIT_BRANCH'
-        #    skip-tag: true
-        #    choosing-strategy: 'gerrit'
-        #    timeout: 10
-        #    wipe-workspace: true
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
             refspec: '$GERRIT_REFSPEC'
@@ -77,6 +73,8 @@
                     comment-contains-value: 'https://jenkins.opendaylight.org/releng/job/netvirt-patch-test-current-carbon/.*?/ : SUCCESS'
                 - comment-added-contains-event:
                     comment-contains-value: 'https://jenkins.opendaylight.org/releng/job/netvirt-patch-test-current-carbon/.*?/ : UNSTABLE'
+                - comment-added-contains-event:
+                    comment-contains-value: 'opnfv-test'
             projects:
               - project-compare-type: 'ANT'
                 project-pattern: '{project}'
     builders:
         - description-setter:
             description: "Built on $NODE_NAME"
-        - shell: |
-            #!/bin/bash
-            ls -al $WORKSPACE
         - multijob:
-            name: install
+            name: create-apex-vms
+            condition: SUCCESSFUL
+            projects:
+                - name: 'odl-netvirt-verify-virtual-create-apex-vms-{stream}'
+                  current-parameters: false
+                  predefined-parameters: |
+                    GERRIT_BRANCH=$GERRIT_BRANCH
+                    GERRIT_REFSPEC=$GERRIT_REFSPEC
+                    GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
+                    GERRIT_CHANGE_ID=$GERRIT_CHANGE_ID
+                    GERRIT_PATCHSET_NUMBER=$GERRIT_PATCHSET_NUMBER
+                    GERRIT_PATCHSET_REVISION=$GERRIT_PATCHSET_REVISION
+                    NETVIRT_ARTIFACT=$NETVIRT_ARTIFACT
+                  node-parameters: false
+                  kill-phase-on: FAILURE
+                  abort-all-job: true
+        - multijob:
+            name: install-netvirt
             condition: SUCCESSFUL
             projects:
-                - name: 'odl-netvirt-verify-virtual-install-{stream}'
+                - name: 'odl-netvirt-verify-virtual-install-netvirt-{stream}'
                   current-parameters: false
                   predefined-parameters: |
                     GERRIT_BRANCH=$GERRIT_BRANCH
             project: '{project}'
         - gerrit-parameter:
             branch: '{branch}'
-        - 'odl-netvirt-virtual-defaults'
+        - '{slave-label}-defaults'
         - '{installer}-defaults'
 
     builders:
 # builder macros
 #####################################
 - builder:
-    name: 'netvirt-verify-install-builder'
+    name: 'netvirt-verify-create-apex-vms-builder'
+    builders:
+        - shell:
+            !include-raw: ./create-apex-vms.sh
+- builder:
+    name: 'netvirt-verify-install-netvirt-builder'
     builders:
         - shell:
             !include-raw: ./download-netvirt-artifact.sh
         - shell:
             !include-raw: ./install-netvirt.sh
-
 - builder:
     name: 'netvirt-verify-functest-builder'
     builders:
         - shell:
             !include-raw: ./functest-netvirt.sh
-
 - builder:
     name: 'netvirt-verify-postprocess-builder'
     builders:
index d1b4b8f..96ad75c 100644 (file)
             default: https://gerrit.opnfv.org/gerrit/$PROJECT
             description: 'Git URL to use on this Jenkins Slave'
 - parameter:
-    name: 'odl-netvirt-virtual-defaults'
+    name: 'ericsson-virtual5-defaults'
     parameters:
         - label:
             name: SLAVE_LABEL
-            default: 'odl-netvirt-virtual'
+            default: 'ericsson-virtual5'
         - string:
             name: GIT_BASE
             default: https://git.opendaylight.org/gerrit/p/$PROJECT.git
             description: 'Git URL to use on this Jenkins Slave'
+- parameter:
+    name: 'ericsson-virtual6-defaults'
+    parameters:
+        - label:
+            name: SLAVE_LABEL
+            default: 'ericsson-virtual6'
+        - string:
+            name: GIT_BASE
+            default: https://git.opendaylight.org/gerrit/p/$PROJECT.git
+            description: 'Git URL to use on this Jenkins Slave'
+        - string:
+            name: APEX_ENV_NUMBER
+            default: 0
+            description: 'The number of the Apex environment on the machine'
 #####################################################
 # These slaves are just dummy slaves for sandbox jobs
 #####################################################