Merge changes I7d7323b8,Ib796cfee
authorAnil Shashikumar Belur <abelur@linuxfoundation.org>
Tue, 15 Aug 2017 00:38:04 +0000 (00:38 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Tue, 15 Aug 2017 00:38:04 +0000 (00:38 +0000)
* changes:
  Add default refspec reference
  Refactor packer ci templates

22 files changed:
jjb-test/expected-xml/gerrit-ciman-jjb-merge
jjb-test/expected-xml/gerrit-ciman-jjb-verify
jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-java-builder
jjb-test/expected-xml/gerrit-ciman-packer-merge-centos-mininet
jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-java-builder
jjb-test/expected-xml/gerrit-ciman-packer-merge-ubuntu1604-mininet
jjb-test/expected-xml/gerrit-ciman-packer-verify
jjb-test/expected-xml/gerrit-maven-maven-clm-master
jjb-test/expected-xml/gerrit-maven-maven-release-master
jjb-test/expected-xml/gerrit-python-tox-verify-master
jjb-test/expected-xml/github-ciman-jjb-merge
jjb-test/expected-xml/github-ciman-jjb-verify
jjb-test/expected-xml/github-ciman-packer-merge-centos-java-builder
jjb-test/expected-xml/github-ciman-packer-merge-centos-mininet
jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-java-builder
jjb-test/expected-xml/github-ciman-packer-merge-ubuntu1604-mininet
jjb-test/expected-xml/github-ciman-packer-verify
jjb-test/expected-xml/github-maven-maven-clm-master
jjb-test/expected-xml/github-maven-maven-release-master
jjb-test/expected-xml/github-python-tox-verify-master
jjb/lf-ci-jobs.yaml
jjb/lf-macros.yaml

index 9f8081e..12b0e87 100644 (file)
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index d5580b3..69c3166 100644 (file)
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 87b5ec9..0565e3c 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 1a7fde3..1bcd155 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 0a54424..7cf25b5 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 62c6857..73c50d5 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 5c963ff..04a3f52 100644 (file)
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 8d5c7a3..150a594 100644 (file)
@@ -63,7 +63,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index b391637..dd4d3e8 100644 (file)
@@ -63,7 +63,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 6908475..885d5a2 100644 (file)
@@ -62,7 +62,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index ad689da..12a5555 100644 (file)
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 83cd7fd..0d8d5b2 100644 (file)
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 1f75c0c..38be921 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index bee3db0..9fb389f 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index b3ca61c..d7df795 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 8bc173b..fe4bb8a 100644 (file)
@@ -5,7 +5,7 @@
   <keepDependencies>false</keepDependencies>
   <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
   <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
-  <concurrentBuild>true</concurrentBuild>
+  <concurrentBuild>false</concurrentBuild>
   <assignedNode>build-vm</assignedNode>
   <canRoam>false</canRoam>
   <properties>
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 20da5d3..6e84f2b 100644 (file)
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index cfe3359..8a9a67f 100644 (file)
@@ -58,7 +58,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 9186d87..73aba06 100644 (file)
@@ -58,7 +58,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index 2d499f8..31b825e 100644 (file)
@@ -57,7 +57,7 @@ job is triggered by Gerrit.
 Note that Gerrit will override this parameter automatically if a
 job is triggered by Gerrit.
 </description>
-          <defaultValue/>
+          <defaultValue>refs/heads/master</defaultValue>
         </hudson.model.StringParameterDefinition>
         <hudson.model.StringParameterDefinition>
           <name>LFTOOLS_VERSION</name>
index adbb26a..d927ca3 100644 (file)
 
 - lf_packer: &lf_packer_common
     name: lf-packer-common
-    # Adds wrappers and parameters sections common to packer jobs.
+    # Provide configuration common in packer jobs.
 
     ######################
     # Default parameters #
     ######################
 
+    branch: master
     build-timeout: 45
+    stream: master
+    submodule-recursive: true
     packer-cloud-settings: packer-cloud-env
 
-    wrappers:
-      - lf-infra-wrappers:
-          build-timeout: '{build-timeout}'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+    #####################
+    # Job Configuration #
+    #####################
+
+    project-type: freestyle
+    node: '{build-node}'
+
+    properties:
+      - lf-infra-properties:
+          project: '{project}'
+          build-days-to-keep: 7
 
     parameters:
       - lf-infra-parameters:
       - lf-infra-packer-parameters:
           packer-version: '{packer-version}'
 
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    publishers:
+      - lf-infra-publish
+
 - parameter:
     name: lf-infra-jjb-parameters
     parameters:
 # Packer Merge #
 ################
 
-- lf_packer_merge_builders: &lf_packer_merge_builders
-    name: lf-packer-merge-builders
+- lf_packer_merge: &lf_packer_merge
+    name: lf-packer-merge
 
-    # Adds builders section common to merge packer jobs.
-    # {packer-cloud-settings} is passed from the project, defines the managed
-    #                   file-id name created in Jenkins
-    #                   (default: packer-cloud-env)
-    # {packer-version}: is global defined in job group level, the version number
-    #                   can be updated to install the latest version of packer.
-    # {platforms}:      defines the packer platform file, passed from the project.
-    # {template}:       defines the packer template file, passed from the project.
+    # Packer Merge job runs `packer build` to build system images in the cloud.
+    #
+    # Required parameters:
+    #
+    #     :build-node: The node to run build on.
+    #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
+    #         be configured in defaults.yaml)
+    #     :mvn-settings: The name of settings file containing credentials for
+    #         the project.
+    #     :platforms: Platform or distribution to build. Typically json file
+    #         found in the packer/vars directory. (Example: centos)
+    #     :template: System template to build. Typically shell script found in
+    #         the packer/provision directory. (Example: java-builder)
+    #
+    # Optional parameters:
+    #
+    #     :branch: Git branch to fetch for the build. (default: master)
+    #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
+    #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
+    #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    #     :packer-cloud-settings: Name of settings file containing credentials
+    #         for the cloud that packer will build on. (default: packer-cloud-env)
+    #     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
+    #     :stream: Keyword that can be used to represent a release code-name.
+    #         Often the same as the branch. (default: master)
+    #     :submodule-recursive: Whether to checkout submodules recursively.
+    #         (default: true)
+    #
+    #     :gerrit_verify_triggers: Override Gerrit Triggers.
+    #     :gerrit_trigger_file_paths: Override file paths which can be used to
+    #         filter which file modifications will trigger a build.
+    #         (default defined by lf_jjb_common)
+
+    ######################
+    # Default parameters #
+    ######################
+
+    gerrit_merge_triggers:
+      - change-merged-event
+      - comment-added-contains-event:
+          comment-contains-value: remerge$
+
+    #####################
+    # Job Configuration #
+    #####################
 
     builders:
       - lf-infra-packer-validate:
 - job-template:
     name: '{project-name}-packer-merge-{platforms}-{templates}'
     id: gerrit-packer-merge
-    concurrent: true
-    <<: *lf_jjb_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_packer_common
     # yamllint disable-line rule:key-duplicates
-    <<: *lf_packer_merge_builders
-
-    ######################
-    # Default parameters #
-    ######################
+    <<: *lf_packer_merge
 
     git-url: '$GIT_URL/$GERRIT_PROJECT'
 
-    gerrit_merge_triggers:
-      - change-merged-event
-      - comment-added-contains-event:
-          comment-contains-value: remerge$
-
-    #####################
-    # Job Configuration #
-    #####################
-
     scm:
       - lf-infra-gerrit-scm:
           git-url: '{git-url}'
 - job-template:
     name: '{project-name}-packer-merge-{platforms}-{templates}'
     id: github-packer-merge
-    concurrent: true
-    <<: *lf_jjb_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_packer_common
     # yamllint disable-line rule:key-duplicates
-    <<: *lf_packer_merge_builders
-
-    #####################
-    # Job Configuration #
-    #####################
+    <<: *lf_packer_merge
 
     properties:
       - github:
 # Packer Verify #
 #################
 
-- lf_packer_verify_builders: &lf_packer_verify_builders
-    name: lf-packer-verify-builders
-
-    # Adds builders section common to verify packer jobs.
-    # {packer-cloud-settings} is passed from the project, defines the managed
-    #                   file-id name created in Jenkins
-    #                   (default: packer-cloud-env)
-    # {packer-version}: is global defined in job group level, the version number
-    #                   can be updated to install the latest version of packer.
+- lf_packer_verify: &lf_packer_verify
+    name: lf-packer-verify
 
-    builders:
-      - lf-infra-packer-validate:
-          packer-cloud-settings: '{packer-cloud-settings}'
-          packer-version: '{packer-version}'
-
-- job-template:
-    name: '{project-name}-packer-verify'
-    id: gerrit-packer-verify
-    concurrent: true
-    <<: *lf_jjb_common
-    # yamllint disable-line rule:key-duplicates
-    <<: *lf_packer_common
-    # yamllint disable-line rule:key-duplicates
-    <<: *lf_packer_verify_builders
+    # Packer Verify job runs `packer validate` to verify packer configuration.
+    #
+    # Required parameters:
+    #
+    #     :build-node: The node to run build on.
+    #     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
+    #         be configured in defaults.yaml)
+    #     :mvn-settings: The name of settings file containing credentials for
+    #         the project.
+    #
+    # Optional parameters:
+    #
+    #     :branch: Git branch to fetch for the build. (default: master)
+    #     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
+    #     :build-timeout: Timeout in seconds before aborting build. (default: 10)
+    #     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+    #     :packer-cloud-settings: Name of settings file containing credentials
+    #         for the cloud that packer will build on. (default: packer-cloud-env)
+    #     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
+    #     :stream: Keyword that can be used to represent a release code-name.
+    #         Often the same as the branch. (default: master)
+    #     :submodule-recursive: Whether to checkout submodules recursively.
+    #         (default: true)
+    #
+    #     :gerrit_verify_triggers: Override Gerrit Triggers.
+    #     :gerrit_trigger_file_paths: Override file paths which can be used to
+    #         filter which file modifications will trigger a build.
+    #         (default defined by lf_jjb_common)
 
     ######################
     # Default parameters #
     ######################
 
     build-timeout: 10
-    git-url: '$GIT_URL/$GERRIT_PROJECT'
 
     gerrit_verify_triggers:
       - patchset-created-event:
     # Job Configuration #
     #####################
 
+    concurrent: true
+
+    builders:
+      - lf-infra-packer-validate:
+          packer-cloud-settings: '{packer-cloud-settings}'
+          packer-version: '{packer-version}'
+
+- job-template:
+    name: '{project-name}-packer-verify'
+    id: gerrit-packer-verify
+    <<: *lf_packer_common
+    # yamllint disable-line rule:key-duplicates
+    <<: *lf_packer_verify
+
+    git-url: '$GIT_URL/$GERRIT_PROJECT'
+
     scm:
       - lf-infra-gerrit-scm:
           git-url: '{git-url}'
 - job-template:
     name: '{project-name}-packer-verify'
     id: github-packer-verify
-    concurrent: true
-    <<: *lf_jjb_common
-    # yamllint disable-line rule:key-duplicates
     <<: *lf_packer_common
     # yamllint disable-line rule:key-duplicates
-    <<: *lf_packer_verify_builders
-
-    ######################
-    # Default parameters #
-    ######################
-
-    build-timeout: 10
-
-    #####################
-    # Job Configuration #
-    #####################
+    <<: *lf_packer_verify
 
     properties:
       - github:
index 0c085c1..af9528c 100644 (file)
               job is triggered by Gerrit.
       - string:
           name: GERRIT_REFSPEC
-          default: ''
+          default: 'refs/heads/{branch}'
           description: |
               Parameter to identify a refspec when pulling from Gerrit.