Separate jobs based on installer 75/175/3
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>
Wed, 25 Mar 2015 20:17:37 +0000 (21:17 +0100)
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>
Wed, 25 Mar 2015 21:19:49 +0000 (22:19 +0100)
Verify, merge, and daily jobs are separated based on installer and
builder macros are created for each installer.

JIRA: OCTO-11

Change-Id: Ide76fc843a8871952873ca86033c40e5c235340b
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
jjb/genesis/genesis.yml

index 8417b78..2b31eb5 100644 (file)
@@ -1,14 +1,15 @@
 - project:
 - project:
+
     name: genesis
     name: genesis
+
+    installer:
+        - foreman
+        - fuel
+        - opensteak
     jobs:
     jobs:
-        - 'genesis-merge'
-        - 'genesis-verify'
-        - 'genesis-foreman-daily-master'
-        - 'genesis-fuel-daily-master'
-        - 'genesis-opensteak-daily-master'
-        - 'genesis-build'
-        - 'genesis-deploy'
-        - 'genesis-test'
+        - 'genesis-{installer}-verify'
+        - 'genesis-{installer}-merge'
+        - 'genesis-{installer}-daily-master'
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
 
     # stream:    branch with - in place of / (eg. stable-helium)
     # branch:    branch (eg. stable/helium)
 
     project: 'genesis'
 
 
     project: 'genesis'
 
+########################
+# job templates
+########################
+
 - job-template:
 - job-template:
-    name: 'genesis-verify'
+    name: 'genesis-{installer}-verify'
 
     project-type: freestyle
 
     project-type: freestyle
+
     node: fuel
 
     logrotate:
     node: fuel
 
     logrotate:
         artifactNumToKeep: -1
 
     parameters:
         artifactNumToKeep: -1
 
     parameters:
+        - string:
+            name: BUILD_DIRECTORY
+            default: $WORKSPACE/build_output
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
             branch: 'master'
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
             branch: 'master'
+
     scm:
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
     scm:
         - gerrit-trigger-scm:
             credentials-id: '{ssh-credentials}'
                 branches:
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/master'
                 branches:
                   - branch-compare-type: 'ANT'
                     branch-pattern: '**/master'
+                file-paths:
+                  - compare-type: ANT
+                    pattern: 'common/**'
+                  - compare-type: ANT
+                    pattern: '{installer}/**'
+
 
     builders:
 
     builders:
-        - shell: |
-            hostname
-            whoami
-            docker --version
-            cd fuel/build/docker
-            pwd
-            echo foo
-            make clean || true
-            make
-            echo "what tests can we run here?"
+        - '{installer}-verify'
 
 - job-template:
 
 - job-template:
-    name: 'genesis-merge'
+    name: 'genesis-{installer}-merge'
 
     # builder-merge job to run JJB update
     #
 
     # builder-merge job to run JJB update
     #
         artifactNumToKeep: 5
 
     parameters:
         artifactNumToKeep: 5
 
     parameters:
+        - string:
+            name: BUILD_DIRECTORY
+            default: $WORKSPACE/build_output
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
         - project-parameter:
             project: '{project}'
         - gerrit-parameter:
                 branches:
                     - branch-compare-type: 'ANT'
                       branch-pattern: '**/master'
                 branches:
                     - branch-compare-type: 'ANT'
                       branch-pattern: '**/master'
+                file-paths:
+                  - compare-type: ANT
+                    pattern: 'common/**'
+                  - compare-type: ANT
+                    pattern: '{installer}/**'
 
     builders:
 
     builders:
-        - shell: |
-            hostname
-            whoami
-            docker --version
-            cd fuel-build/docker
-            pwd
-            echo foo
-            make clean || true
-            make
-            cd ..
-            echo foo
-            make clean || true
-            make all
+        - '{installer}-merge'
 
 - job-template:
 
 - job-template:
-    name: genesis-foreman-daily-master
+    name: 'genesis-{installer}-daily-master'
 
     project-type: freestyle
 
     disabled: true
 
 
     project-type: freestyle
 
     disabled: true
 
-    node: foreman
-
-    parameters:
-        - string:
-            name: INSTALLER
-            default: foreman
-            description: "Installer to use."
-        - string:
-            name: GERRIT_BRANCH
-            default: origin/master
-            description: "Branch to build, deploy and test."
-        - string:
-            name: GERRIT_REFSPEC
-            default: refs/heads/master
-            description: "Refspec to retrieve."
-
-    scm:
-        - git:
-            skip-tag: true
-            url: https://gerrit.opnfv.org/gerrit/genesis
-            branches:
-                - $GERRIT_BRANCH
-            refspec: $GERRIT_REFSPEC
-
-    triggers:
-        - pollscm: '@midnight'
-
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    builders:
-        - trigger-builds:
-            - project: genesis-build
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
-            - project: genesis-deploy
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
-            - project: genesis-test
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
-- job-template:
-    name: genesis-fuel-daily-master
-
-    project-type: freestyle
-
-    disabled: false
-
     node: fuel
 
     parameters:
         - string:
     node: fuel
 
     parameters:
         - string:
-            name: INSTALLER
-            default: fuel
-            description: "Installer to use."
-        - string:
-            name: GERRIT_BRANCH
-            default: origin/master
-            description: "Branch to build, deploy and test."
-        - string:
-            name: GERRIT_REFSPEC
-            default: refs/heads/master
-            description: "Refspec to retrieve."
-
-    scm:
-        - git:
-            skip-tag: true
-            url: https://gerrit.opnfv.org/gerrit/genesis
-            branches:
-                - $GERRIT_BRANCH
-            refspec: $GERRIT_REFSPEC
-
-    triggers:
-        - pollscm: '@midnight'
-
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    builders:
-        - trigger-builds:
-            - project: genesis-build
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: false
-              block: true
-            - project: genesis-deploy
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: false
-              block: true
-            - project: genesis-test
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: false
-              block: true
-- job-template:
-    name: genesis-opensteak-daily-master
-
-    project-type: freestyle
-
-    disabled: true
-
-    node: opensteak
-
-    parameters:
+            name: BUILD_DIRECTORY
+            default: $WORKSPACE/build_output
         - string:
             name: INSTALLER
         - string:
             name: INSTALLER
-            default: opensteak
+            default: '{installer}'
             description: "Installer to use."
         - string:
             name: GERRIT_BRANCH
             description: "Installer to use."
         - string:
             name: GERRIT_BRANCH
         artifactNumToKeep: -1
 
     builders:
         artifactNumToKeep: -1
 
     builders:
-        - trigger-builds:
-            - project: genesis-build
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
-            - project: genesis-deploy
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
-            - project: genesis-test
-              current-parameters: true
-              predefined-parameters: GERRIT_BRANCH=$GIT_COMMIT
-              same-node: true
-              block: true
+        - '{installer}-daily-master'
 
 
-- job-template:
-    name: genesis-build
+########################
+# builder macros
+########################
+- builder:
+    name: foreman-verify
+    builders:
+        - shell: |
+            #!/bin/bash
 
 
-    node: ericsson-build
+            echo "Hello World!"
 
 
-    project-type: freestyle
+- builder:
+    name: foreman-merge
+    builders:
+        - shell: |
+            #!/bin/bash
 
 
-    disabled: false
+            echo "Hello World!"
 
 
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    parameters:
-        - string:
-            name: INSTALLER
-            description: "Installer to use. Mandatory parameter."
-        - string:
-            name: GERRIT_BRANCH
-            default: master
-            description: "Branch to build, deploy and test."
-        - string:
-            name: GERRIT_REFSPEC
-            default: refs/heads/master
-            description: "Refspec to retrieve."
-        - string:
-            name: BUILD_DIRECTORY
-            default: $WORKSPACE/build_output
-            description: "The directory where the artifact will be placed upon completion of the build."
+- builder:
+    name: foreman-daily-master
+    builders:
+        - shell: |
+            #!/bin/bash
 
 
-    scm:
-        - git:
-            skip-tag: true
-            url: https://gerrit.opnfv.org/gerrit/genesis
-            branches:
-                - $GERRIT_BRANCH
-            refspec: $GERRIT_REFSPEC
+            echo "Hello World!"
 
 
+- builder:
+    name: fuel-verify
     builders:
         - shell: |
             #!/bin/bash
     builders:
         - shell: |
             #!/bin/bash
-
             set -o errexit
             set -o nounset
             set -o pipefail
             set -o errexit
             set -o nounset
             set -o pipefail
             ./build.sh $BUILD_DIRECTORY
             ls -al $BUILD_DIRECTORY
 
             ./build.sh $BUILD_DIRECTORY
             ls -al $BUILD_DIRECTORY
 
-- job-template:
-    name: genesis-deploy
-
-    node: ericsson-build
-
-    project-type: freestyle
-
-    disabled: false
-
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    parameters:
-        - string:
-            name: INSTALLER
-            description: "Installer to use. Mandatory parameter."
-        - string:
-            name: GERRIT_BRANCH
-            default: master
-            description: "Branch to build, deploy and test."
-        - string:
-            name: GERRIT_REFSPEC
-            default: refs/heads/master
-            description: "Refspec to retrieve."
-
-    scm:
-        - git:
-            skip-tag: true
-            url: https://gerrit.opnfv.org/gerrit/genesis
-            branches:
-                - $GERRIT_BRANCH
-            refspec: $GERRIT_REFSPEC
-
+- builder:
+    name: fuel-merge
     builders:
         - shell: |
             #!/bin/bash
     builders:
         - shell: |
             #!/bin/bash
-
             set -o errexit
             set -o nounset
             set -o pipefail
 
             set -o errexit
             set -o nounset
             set -o pipefail
 
-            echo cd $WORKSPACE/$INSTALLER/ci
-            echo ./build.sh
+            cd $WORKSPACE/fuel/ci
+            ./build.sh -f t $BUILD_DIRECTORY
+            ls -al $BUILD_DIRECTORY
 
 
-- job-template:
-    name: genesis-test
+- builder:
+    name: fuel-daily-master
+    builders:
+        - shell: |
+            #!/bin/bash
+            set -o errexit
+            set -o nounset
+            set -o pipefail
 
 
-    node: ericsson-build
+            cd $WORKSPACE/fuel/ci
+            ./build.sh -f t $BUILD_DIRECTORY
+            ls -al $BUILD_DIRECTORY
 
 
-    project-type: freestyle
+- builder:
+    name: opensteak-verify
+    builders:
+        - shell: |
+            #!/bin/bash
 
 
-    disabled: false
+            echo "Hello World!"
 
 
-    logrotate:
-        daysToKeep: 30
-        numToKeep: 10
-        artifactDaysToKeep: -1
-        artifactNumToKeep: -1
-
-    parameters:
-        - string:
-            name: INSTALLER
-            description: "Installer to use. Mandatory parameter."
-        - string:
-            name: GERRIT_BRANCH
-            default: master
-            description: "Branch to build, deploy and test."
-        - string:
-            name: GERRIT_REFSPEC
-            default: refs/heads/master
-            description: "Refspec to retrieve."
+- builder:
+    name: opensteak-merge
+    builders:
+        - shell: |
+            #!/bin/bash
 
 
-    scm:
-        - git:
-            skip-tag: true
-            url: https://gerrit.opnfv.org/gerrit/genesis
-            branches:
-                - $GERRIT_BRANCH
-            refspec: $GERRIT_REFSPEC
+            echo "Hello World!"
 
 
+- builder:
+    name: opensteak-daily-master
     builders:
         - shell: |
             #!/bin/bash
 
     builders:
         - shell: |
             #!/bin/bash
 
-            set -o errexit
-            set -o nounset
-            set -o pipefail
-
-            echo cd $WORKSPACE/$INSTALLER/ci
-            echo ./test.sh
+            echo "Hello World!"