Remove lftools install step from clm job
[releng/global-jjb.git] / jjb / lf-maven-jobs.yaml
index 0f52524..41c73e7 100644 (file)
     # for any project ci that is using github.
 
     jobs:
-      - gerrit-maven-clm
+      - github-maven-clm
       - github-maven-release
 
 ####################
-# Anchors & Macros #
+# COMMON FUNCTIONS #
 ####################
 
-- lf_maven_clm: &lf_maven_clm
-    name: lf-maven-clm
-
-    # Produces a CLM scan of the code into Nexus IQ Server.
-    #
-    # 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)
-    #     settings-file: The name of settings file containing credentials for
-    #                    the project.
-    #     global-settings-file: The name of the Maven global settings to use for
-    #                           Maven configuration.
+- lf_maven_common: &lf_maven_common
+    name: lf-maven-common
 
     project-type: freestyle
     node: '{build-node}'
     jdk: '{java-version}'
 
-    ######################
-    # Default parameters #
-    ######################
-
-    branch: master
-    build-timeout: 15
-    git-url: '$GIT_URL/$PROJECT'
-    global-settings-file: global-settings
-    java-version: openjdk8
-    mvn-opts: ''
-    mvn-params: ''
-    mvn-version: mvn33
-    stream: master
-    submodule-recursive: true
-
-    #####################
-    # Job Configuration #
-    #####################
-
     properties:
       - lf-infra-properties:
-          # Keep around for 30 days for troubleshooting purposes.
-          build-days-to-keep: 30
+          build-days-to-keep: '{build-days-to-keep}'
 
     parameters:
       - lf-infra-parameters:
           mvn-params: '{mvn-params}'
           mvn-version: '{mvn-version}'
           # Staging repos do not make sense for CLM jobs so set it blank.
-          staging-profile-id: ''
+          staging-profile-id: '{staging-profile-id}'
 
     wrappers:
       - lf-infra-wrappers:
           build-timeout: '{build-timeout}'
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
-    builders:
-      - lf-maven-install:
-          mvn-version: '{mvn-version}'
-      - lf-provide-maven-settings:
-          global-settings-file: '{global-settings-file}'
-          settings-file: '{settings-file}'
-      - shell: !include-raw-escape:
-          - ../shell/lftools-install.sh
-          - ../shell/common-variables.sh
-          - ../shell/sonatype-clm.sh
-      - lf-provide-maven-settings-cleanup
-      - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
-      - sonatype-clm:
-          application-name: '{project-name}'
-
     publishers:
+      # TODO: Make email notification work.
+      # - lf-infra-email-notify:
+      #     email-recipients: '{email-recipients}'
+      #     email-prefix: '[releng]'
       - lf-infra-publish
 
-- lf_maven_release: &lf_maven_release
-    name: lf-maven-release
+#############
+# Maven CLM #
+#############
 
-    # Produces a release candidate by creating a staging repo in Nexus.
-    #
-    # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
-    # directory can then be reused later to deploy to Nexus.
+- lf_maven_clm: &lf_maven_clm
+    name: lf-maven-clm
+
+    # Produces a CLM scan of the code into Nexus IQ Server.
     #
     # 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)
-    #     settings-file: The name of settings file containing credentials for
-    #                    the project.
-    #     global-settings-file: The name of the Maven global settings to use for
-    #                           Maven configuration.
-    #     staging-profile-id: Profile ID of the project's Nexus staging profile.
-
-    project-type: freestyle
-    node: '{build-node}'
-    jdk: '{java-version}'
+    #     mvn-settings: The name of settings file containing credentials for
+    #                   the project.
+    #
+    # Optional parameters:
+    #     mvn-global-settings: The name of the Maven global settings to use for
+    #                          Maven configuration. (default: global-settings)
 
     ######################
     # Default parameters #
     ######################
 
     branch: master
-    build-timeout: 30
+    build-days-to-keep: 30  # 30 days for troubleshooting purposes
+    build-timeout: 15
     git-url: '$GIT_URL/$PROJECT'
-    global-settings-file: global-settings
     java-version: openjdk8
+    mvn-global-settings: global-settings
     mvn-opts: ''
     mvn-params: ''
     mvn-version: mvn33
     stream: master
     submodule-recursive: true
 
+    # Staging repos do not make sense for CLM jobs so set it blank.
+    staging-profile-id: ''
+
     #####################
     # Job Configuration #
     #####################
 
-    properties:
-      - lf-infra-properties:
-          # Keep around for 30 days in case a release takes long to get approved.
-          build-days-to-keep: 30
-
-    parameters:
-      - lf-infra-parameters:
-          project: '{project}'
-          branch: '{branch}'
-          stream: '{stream}'
-      - lf-infra-maven-parameters:
-          mvn-opts: '{mvn-opts}'
-          mvn-params: '{mvn-params}'
-          mvn-version: '{mvn-version}'
-          staging-profile-id: '{staging-profile-id}'
-
-    wrappers:
-      - lf-infra-wrappers:
-          build-timeout: '{build-timeout}'
-          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+    triggers:
+      # Build weekly on Saturdays
+      - timed: 'H H * * 6'
 
     builders:
-      - lf-jacoco-nojava-workaround
       - lf-maven-install:
           mvn-version: '{mvn-version}'
       - lf-provide-maven-settings:
-          global-settings-file: '{global-settings-file}'
-          settings-file: '{settings-file}'
-      - lf-infra-create-netrc:
-          server-id: opendaylight-staging
+          global-settings-file: '{mvn-global-settings}'
+          settings-file: '{mvn-settings}'
       - shell: !include-raw-escape:
-          - ../shell/lftools-install.sh
           - ../shell/common-variables.sh
-          - ../shell/maven-patch-release.sh
-          - ../shell/maven-build.sh
-          - ../shell/maven-stage.sh
+          - ../shell/sonatype-clm.sh
       - lf-provide-maven-settings-cleanup
-
-    publishers:
-      # TODO: Make email notification work.
-      # - lf-infra-email-notify:
-      #     email-recipients: '{email-recipients}'
-      #     email-prefix: '[releng]'
-      - lf-infra-publish
-
-
-#################
-# Job Templates #
-#################
+      - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
+      - sonatype-clm:
+          application-name: '{project-name}'
 
 - job-template:
     name: '{project-name}-maven-clm-{stream}'
     id: gerrit-maven-clm
+    <<: *lf_maven_common
+    # yamllint disable-line rule:key-duplicates
     <<: *lf_maven_clm
 
     scm:
 - job-template:
     name: '{project-name}-maven-clm-{stream}'
     id: github-maven-clm
+    <<: *lf_maven_common
+    # yamllint disable-line rule:key-duplicates
     <<: *lf_maven_clm
 
     properties:
           choosing-strategy: default
           jenkins-ssh-credential: '{jenkins-ssh-credential}'
 
+#################
+# Maven Release #
+#################
+
+- lf_maven_release: &lf_maven_release
+    name: lf-maven-release
+
+    # Produces a release candidate by creating a staging repo in Nexus.
+    #
+    # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
+    # directory can then be reused later to deploy to Nexus.
+    #
+    # 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.
+    #     staging-profile-id: Profile ID of the project's Nexus staging profile.
+    #
+    # Optional parameters:
+    #     mvn-global-settings: The name of the Maven global settings to use for
+    #                          Maven configuration. (default: global-settings)
+
+    ######################
+    # Default parameters #
+    ######################
+
+    branch: master
+    build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
+    build-timeout: 30
+    git-url: '$GIT_URL/$PROJECT'
+    java-version: openjdk8
+    mvn-global-settings: global-settings
+    mvn-opts: ''
+    mvn-params: ''
+    mvn-version: mvn33
+    stream: master
+    submodule-recursive: true
+
+    #####################
+    # Job Configuration #
+    #####################
+
+    builders:
+      - lf-jacoco-nojava-workaround
+      - lf-maven-install:
+          mvn-version: '{mvn-version}'
+      - lf-provide-maven-settings:
+          global-settings-file: '{mvn-global-settings}'
+          settings-file: '{mvn-settings}'
+      - lf-infra-create-netrc:
+          server-id: opendaylight-staging
+      - shell: !include-raw-escape:
+          - ../shell/lftools-install.sh
+          - ../shell/common-variables.sh
+          - ../shell/maven-patch-release.sh
+          - ../shell/maven-build.sh
+          - ../shell/maven-stage.sh
+      - lf-provide-maven-settings-cleanup
+
 - job-template:
     name: '{project-name}-maven-release-{stream}'
     id: gerrit-maven-release
+    <<: *lf_maven_common
+    # yamllint disable-line rule:key-duplicates
     <<: *lf_maven_release
 
     scm:
 - job-template:
     name: '{project-name}-maven-release-{stream}'
     id: github-maven-release
+    <<: *lf_maven_common
+    # yamllint disable-line rule:key-duplicates
     <<: *lf_maven_release
 
     properties: