2 # This file contains job templates for Maven projects.
5 name: '{project-name}-maven-jobs'
7 # This job group contains all the recommended jobs that should be deployed
12 - gerrit-maven-release
15 name: '{project-name}-github-maven-jobs'
17 # This job group contains all the recommended jobs that should be deployed
18 # for any project ci that is using github.
22 - github-maven-release
28 - lf_maven_clm: &lf_maven_clm
31 # Produces a CLM scan of the code into Nexus IQ Server.
33 # Required parameters:
34 # build-node: The node to run build on.
35 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
36 # be configured in defaults.yaml)
37 # settings-file: The name of settings file containing credentials for
39 # global-settings-file: The name of the Maven global settings to use for
40 # Maven configuration.
42 project-type: freestyle
46 ######################
47 # Default parameters #
48 ######################
52 git-url: '$GIT_URL/$PROJECT'
53 global-settings-file: global-settings
54 java-version: openjdk8
58 submodule-recursive: true
65 - lf-infra-properties:
66 # Keep around for 30 days for troubleshooting purposes.
67 build-days-to-keep: 30
70 - lf-infra-parameters:
73 - lf-infra-maven-parameters
77 build-timeout: '{build-timeout}'
78 jenkins-ssh-credential: '{jenkins-ssh-credential}'
82 mvn-version: '{mvn-version}'
83 - lf-provide-maven-settings:
84 global-settings-file: '{global-settings-file}'
85 settings-file: '{settings-file}'
86 - shell: !include-raw-escape:
87 - ../shell/lftools-install.sh
88 - ../shell/common-variables.sh
89 - ../shell/sonatype-clm.sh
90 - lf-provide-maven-settings-cleanup
91 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
93 application-name: '{project-name}'
98 - lf_maven_release: &lf_maven_release
99 name: lf-maven-release
101 # Produces a release candidate by creating a staging repo in Nexus.
103 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
104 # directory can then be reused later to deploy to Nexus.
106 # Required parameters:
107 # build-node: The node to run build on.
108 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
109 # be configured in defaults.yaml)
110 # settings-file: The name of settings file containing credentials for
112 # global-settings-file: The name of the Maven global settings to use for
113 # Maven configuration.
114 # staging-profile-id: Profile ID of the project's Nexus staging profile.
116 project-type: freestyle
118 jdk: '{java-version}'
120 ######################
121 # Default parameters #
122 ######################
126 git-url: '$GIT_URL/$PROJECT'
127 global-settings-file: global-settings
128 java-version: openjdk8
133 submodule-recursive: true
135 #####################
136 # Job Configuration #
137 #####################
140 - lf-infra-properties:
141 # Keep around for 30 days in case a release takes long to get approved.
142 build-days-to-keep: 30
145 - lf-infra-parameters:
149 - lf-infra-maven-parameters:
150 mvn-opts: '{mvn-opts}'
151 mvn-params: '{mvn-params}'
152 mvn-version: '{mvn-version}'
153 staging-profile-id: '{staging-profile-id}'
157 build-timeout: '{build-timeout}'
158 jenkins-ssh-credential: '{jenkins-ssh-credential}'
161 - lf-jacoco-nojava-workaround
163 mvn-version: '{mvn-version}'
164 - lf-provide-maven-settings:
165 global-settings-file: '{global-settings-file}'
166 settings-file: '{settings-file}'
167 - lf-infra-create-netrc:
168 server-id: opendaylight-staging
169 - shell: !include-raw-escape:
170 - ../shell/lftools-install.sh
171 - ../shell/common-variables.sh
172 - ../shell/maven-patch-release.sh
173 - ../shell/maven-build.sh
174 - ../shell/maven-stage.sh
175 - lf-provide-maven-settings-cleanup
178 # TODO: Make email notification work.
179 # - lf-infra-email-notify:
180 # email-recipients: '{email-recipients}'
181 # email-prefix: '[releng]'
190 name: '{project-name}-maven-clm-{stream}'
195 - lf-infra-gerrit-scm:
196 jenkins-ssh-credential: '{jenkins-ssh-credential}'
198 refspec: '$GERRIT_REFSPEC'
199 branch: '$GERRIT_BRANCH'
200 submodule-recursive: '{submodule-recursive}'
201 choosing-strategy: default
204 name: '{project-name}-maven-clm-{stream}'
210 url: '{git-url}/{github-org}/{project}'
213 - lf-infra-github-scm:
214 url: '{git-clone-url}{github-org}/{project}'
215 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
217 submodule-recursive: '{submodule-recursive}'
218 choosing-strategy: default
219 jenkins-ssh-credential: '{jenkins-ssh-credential}'
222 name: '{project-name}-maven-release-{stream}'
223 id: gerrit-maven-release
224 <<: *lf_maven_release
227 - lf-infra-gerrit-scm:
228 jenkins-ssh-credential: '{jenkins-ssh-credential}'
230 refspec: '$GERRIT_REFSPEC'
231 branch: '$GERRIT_BRANCH'
232 submodule-recursive: '{submodule-recursive}'
233 choosing-strategy: default
236 name: '{project-name}-maven-release-{stream}'
237 id: github-maven-release
238 <<: *lf_maven_release
242 url: '{git-url}/{github-org}/{project}'
245 - lf-infra-github-scm:
246 url: '{git-clone-url}{github-org}/{project}'
247 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
249 submodule-recursive: '{submodule-recursive}'
250 choosing-strategy: default
251 jenkins-ssh-credential: '{jenkins-ssh-credential}'