Merge changes I473ef076,I036098e2
[releng/builder.git] / jjb / releng-maven-mri-stage.yaml
1 ####################
2 # COMMON FUNCTIONS #
3 ####################
4
5 - releng_maven_mri_common: &releng_maven_mri_common
6     name: releng-maven-mri-common
7
8     ######################
9     # Default parameters #
10     ######################
11
12     archive-artifacts: >
13       **/*.log
14       **/hs_err_*.log
15       **/target/**/feature.xml
16       **/target/failsafe-reports/failsafe-summary.xml
17       **/target/surefire-reports/*-output.txt
18
19     #####################
20     # Job Configuration #
21     #####################
22
23     project-type: freestyle
24     node: "{build-node}"
25
26     properties:
27       - lf-infra-properties:
28           build-days-to-keep: "{build-days-to-keep}"
29
30     parameters:
31       - lf-infra-parameters:
32           project: "{project}"
33           branch: "{branch}"
34           stream: "{stream}"
35       - lf-infra-maven-parameters:
36           mvn-opts: "{mvn-opts}"
37           mvn-params: "{mvn-params}"
38           mvn-version: "{mvn-version}"
39       - string:
40           name: ARCHIVE_ARTIFACTS
41           default: "{archive-artifacts}"
42           description: Artifacts to archive to the logs server.
43
44     wrappers:
45       - lf-infra-wrappers:
46           build-timeout: "{build-timeout}"
47           jenkins-ssh-credential: "{jenkins-ssh-credential}"
48
49     publishers:
50       # TODO: Make email notification work.
51       # - lf-infra-email-notify:
52       #     email-recipients: '{email-recipients}'
53       #     email-prefix: '[releng]'
54       - lf-infra-publish
55
56 - builder:
57     name: maven-mri-stage
58     builders:
59       - lf-provide-maven-settings:
60           global-settings-file: "{mvn-global-settings}"
61           settings-file: "{mvn-settings}"
62       - lf-infra-create-netrc:
63           server-id: "{mvn-staging-id}"
64       # include-raw-escape fails due to JJB bug
65       - shell: !include-raw-escape:
66           - global-jjb/shell/common-variables.sh
67           - releng-maven-mri-stage.sh
68       - lf-provide-maven-settings-cleanup
69
70 ###############
71 # Maven Stage #
72 ###############
73
74 - releng_maven_mri_stage: &releng_maven_mri_stage
75     name: releng-maven-mri-stage
76
77     ######################
78     # Default parameters #
79     ######################
80
81     branch: master
82     build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
83     build-timeout: 60
84     cron: "@daily"
85     disable-job: false
86     git-url: "$GIT_URL/$PROJECT"
87     github-url: "https://github.com"
88     java-version: openjdk8
89     maven-versions-plugin: false
90     version-properties-file: version.properties
91     mvn-central: false
92     mvn-global-settings: global-settings
93     mvn-goals: clean deploy
94     mvn-opts: ""
95     mvn-params: ""
96     mvn-version: mvn35
97     ossrh-profile-id: ""
98     mvn-pom: ""
99     sign-artifacts: false
100     sign-mode: serial
101     stream: master
102     submodule-recursive: true
103     submodule-timeout: 10
104     submodule-disable: false
105
106     gerrit_release_triggers:
107       - comment-added-contains-event:
108           comment-contains-value: '^Patch Set\s+\d+:\s+stage-(maven-)?release\s*$'
109
110     gerrit_trigger_file_paths:
111       - compare-type: ANT
112         pattern: "**"
113
114     # github_included_regions MUST match gerrit_trigger_file_paths
115     github_included_regions:
116       - ".*"
117
118     #####################
119     # Job Configuration #
120     #####################
121
122     disabled: "{disable-job}"
123
124     parameters:
125       - lf-infra-parameters:
126           project: "{project}"
127           branch: "{branch}"
128           stream: "{stream}"
129       - lf-infra-maven-parameters:
130           mvn-opts: "{mvn-opts}"
131           mvn-params: "{mvn-params}"
132           mvn-version: "{mvn-version}"
133           staging-profile-id: "{staging-profile-id}"
134       - bool:
135           name: MAVEN_VERSIONS_PLUGIN
136           default: "{maven-versions-plugin}"
137           description: Use maven-versions-plugin to update pom versions.
138       - string:
139           name: ARCHIVE_ARTIFACTS
140           default: "{archive-artifacts}"
141           description: Artifacts to archive to the logs server.
142       - string:
143           name: STAGING_PROFILE_ID
144           default: "{staging-profile-id}"
145           description: Nexus staging profile ID.
146
147     builders:
148       - lf-infra-pre-build
149       - lf-jacoco-nojava-workaround
150       - integration-set-variables
151       - lf-maven-install:
152           mvn-version: "{mvn-version}"
153       - lf-update-java-alternatives:
154           java-version: "{java-version}"
155       - lf-provide-maven-settings:
156           global-settings-file: "{mvn-global-settings}"
157           settings-file: "{mvn-settings}"
158       - lf-maven-versions-plugin:
159           maven-versions-plugin: "{maven-versions-plugin}"
160           version-properties-file: "{version-properties-file}"
161           mvn-version: "{mvn-version}"
162           mvn-pom: "{mvn-pom}"
163           mvn-settings: "{mvn-settings}"
164       - shell: !include-raw-escape: global-jjb/shell/maven-patch-release.sh
165       - lf-maven-build:
166           mvn-goals: "{mvn-goals}"
167       - lf-sigul-sign-dir:
168           sign-artifacts: "{sign-artifacts}"
169           sign-dir: "$WORKSPACE/m2repo"
170           sign-mode: "{sign-mode}"
171       - maven-mri-stage:
172           mvn-global-settings: "{mvn-global-settings}"
173           mvn-settings: "{mvn-settings}"
174           mvn-staging-id: "{mvn-staging-id}"
175       - lf-maven-central:
176           mvn-central: "{mvn-central}"
177           mvn-global-settings: "{mvn-global-settings}"
178           mvn-settings: "{mvn-settings}"
179           ossrh-profile-id: "{ossrh-profile-id}"
180       - lf-provide-maven-settings-cleanup
181       - inject:
182           properties-file: maven-staged-bundle.env
183       - trigger-builds:
184           - project: "{project-name}-distribution-mri-test-{stream}"
185             block: true
186             predefined-parameters: |
187               BUNDLE_URL=$BUNDLE_URL
188               KARAF_VERSION=$KARAF_VERSION
189
190 - job-template:
191     name: "{project-name}-maven-mri-stage-{stream}"
192     id: gerrit-maven-mri-stage
193     <<: *releng_maven_mri_common
194     # yamllint disable-line rule:key-duplicates
195     <<: *releng_maven_mri_stage
196
197     scm:
198       - lf-infra-gerrit-scm:
199           jenkins-ssh-credential: "{jenkins-ssh-credential}"
200           git-url: "{git-url}"
201           refspec: "$GERRIT_REFSPEC"
202           branch: "$GERRIT_BRANCH"
203           submodule-recursive: "{submodule-recursive}"
204           submodule-timeout: "{submodule-timeout}"
205           submodule-disable: "{submodule-disable}"
206           choosing-strategy: default