Revert "CI: Rename global-settings to mvn-glob..."
[ci-management.git] / jjb / akraino-templates / akraino-jjb-kni.yaml
1 ---
2 #
3 # Copyright (c) 2019 Red Hat. All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 # not use this file except in compliance with the License.
7 #
8 # You may obtain a copy of the License at
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17
18 # A builder to ship logs from a bare metal Akraino deploy test node.
19 # Similar to lf-infra-ship-logs without python-tools-install.sh and
20 # job-cost.sh.
21 - builder:
22     name: kni-deploy-ship-logs
23     builders:
24       # Ensure no pre-existing .netrc files are overriding logs config
25       - lf-provide-maven-settings-cleanup
26       - config-file-provider:
27           files:
28             - file-id: "jenkins-log-archives-settings"
29               variable: "SETTINGS_FILE"
30       - lf-infra-create-netrc:
31           server-id: logs
32       - shell: !include-raw:
33           - ../../global-jjb/shell/logs-deploy.sh
34       - shell: !include-raw:
35           - ../../global-jjb/shell/logs-clear-credentials.sh
36       - description-setter:
37           regexp: "(^(Nexus|S3) build logs: .*)"
38
39 - kni_common: &kni_common
40     name: kni-common
41
42     ######################
43     # Default parameters #
44     ######################
45
46     build-node: "{build-node}"
47     build-days-to-keep: 30
48     build-timeout: 60
49     submodule-recursive: true
50     gerrit_trigger_file_paths: "{obj:gerrit_trigger_file_paths}"
51
52     #####################
53     # Job Configuration #
54     #####################
55
56     project-type: freestyle
57     node: "{build-node}"
58     properties:
59       - lf-infra-properties:
60           build-days-to-keep: '{build-days-to-keep}'
61
62     parameters:
63       - lf-infra-parameters:
64           project: '{project}'
65           branch: '{branch}'
66           stream: '{stream}'
67           lftools-version: '{lftools-version}'
68
69     wrappers:
70       - lf-infra-wrappers:
71           build-timeout: '{build-timeout}'
72           jenkins-ssh-credential: '{jenkins-ssh-credential}'
73
74     scm:
75       - lf-infra-gerrit-scm:
76           jenkins-ssh-credential: '{jenkins-ssh-credential}'
77           git-url: '{git-url}/{project}.git'
78           refspec: '$GERRIT_REFSPEC'
79           branch: '$GERRIT_BRANCH'
80           submodule-recursive: '{submodule-recursive}'
81           submodule-timeout: '{submodule-timeout}'
82           submodule-disable: false
83           choosing-strategy: gerrit
84
85     gerrit_verify_triggers:
86       - patchset-created-event:
87           exclude-drafts: true
88           exclude-trivial-rebase: false
89           exclude-no-code-change: false
90       - draft-published-event
91       - comment-added-contains-event:
92           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
93
94     triggers:
95       - gerrit:
96           server-name: '{gerrit-server-name}'
97           trigger-on: '{obj:gerrit_verify_triggers}'
98           projects:
99             - project-compare-type: ANT
100               project-pattern: '{project}'
101               branches:
102                 - branch-compare-type: ANT
103                   branch-pattern: '**/{branch}'
104               file-paths: '{obj:gerrit_trigger_file_paths}'
105     publishers:
106       - lf-infra-publish
107
108 - kni_common_deploy: &kni_common_deploy
109     name: kni-common-deploy
110     <<: *kni_common
111     archive-artifacts: >
112       **/*.log
113
114     parameters:
115       - lf-infra-parameters:
116           project: '{project}'
117           branch: '{branch}'
118           stream: '{stream}'
119           lftools-version: '{lftools-version}'
120       - string:
121           name: ARCHIVE_ARTIFACTS
122           default: '{archive-artifacts}'
123           description: Artifacts to archive to the logs server.
124
125     wrappers:
126       - lf-infra-wrappers:
127           build-timeout: '{build-timeout}'
128           jenkins-ssh-credential: '{jenkins-ssh-credential}'
129       - credentials-binding:
130           - ssh-user-private-key:
131               credential-id: kni-secrets
132               key-file-variable: KNI_KEY_PATH
133     scm:
134       - akraino-lf-infra-gerrit-scm:
135           jenkins-ssh-credential: '{jenkins-ssh-credential}'
136           git-url: '{git-url}/{project}.git'
137           refspec: '$GERRIT_REFSPEC'
138           branch: '$GERRIT_BRANCH'
139           submodule-recursive: '{submodule-recursive}'
140           submodule-timeout: '{submodule-timeout}'
141           submodule-disable: false
142           choosing-strategy: gerrit
143           basedir: '{project-name}'
144       - akraino-lf-infra-gerrit-scm:
145           jenkins-ssh-credential: '{jenkins-ssh-credential}'
146           git-url: '{git-url}/kni/installer.git'
147           refspec: 'refs/heads/master'
148           branch: 'master'
149           submodule-recursive: '{submodule-recursive}'
150           submodule-timeout: '{submodule-timeout}'
151           submodule-disable: false
152           choosing-strategy: default
153           basedir: 'installer'
154
155     publishers:
156       - postbuildscript:
157           builders:
158             - role: BOTH
159               build-on:
160                 - ABORTED
161                 - FAILURE
162                 - NOT_BUILT
163                 - SUCCESS
164                 - UNSTABLE
165               build-steps:
166                 - kni-deploy-ship-logs
167           mark-unstable-if-failed: true
168       - workspace-cleanup:
169           exclude:
170             # Do not clean up *.jenkins-trigger files for jobs that use a
171             # properties file as input for triggering another build.
172             - "**/*.jenkins-trigger"
173           fail-build: false
174
175 - job-template:
176     id: kni-installer-verify-installer
177     name: '{project-name}-verify-installer'
178     gerrit_trigger_file_paths:
179       - compare-type: ANT
180         pattern: '**'
181     <<: *kni_common
182     build-node: centos7-builder-2c-1g
183
184     builders:
185       - lf-infra-pre-build
186       - shell: !include-raw-escape:
187           - ../shell/install_go.sh
188       - shell: !include-raw-escape:
189           - ../shell/build_kni_installer.sh
190
191 - job-template:
192     id: kni-verify-deploy-aws
193     name: 'kni-{project-name}-verify-deploy-aws'
194     build-node: kni-cloud
195     <<: *kni_common_deploy
196
197     gerrit_trigger_file_paths:
198       - compare-type: ANT
199         pattern: 'profiles/production.aws/**'
200       - compare-type: ANT
201         pattern: 'sites/testing.aws.edge-sites.net/**'
202       - compare-type: ANT
203         pattern: 'base/**'
204
205     builders:
206       - lf-infra-pre-build
207       - config-file-provider:
208           files:
209             - file-id: kni-coreos-pull-secret
210               target: akraino-secrets/coreos-pull-secret
211       - shell: !include-raw-escape:
212           - ../shell/install_go.sh
213       - shell: ./installer/ci/kni_deploy_aws.sh
214
215 - job-template:
216     id: kni-verify-deploy-gcp
217     name: 'kni-{project-name}-verify-deploy-gcp'
218     site: edge-sites-testing.gcp.devcluster.openshift.com
219     build-node: kni-cloud
220     <<: *kni_common_deploy
221
222     gerrit_trigger_file_paths:
223       - compare-type: ANT
224         pattern: 'profiles/production.gcp/**'
225       - compare-type: ANT
226         pattern: 'sites/edge-sites-testing.gcp.devcluster.openshift.com/**'
227       - compare-type: ANT
228         pattern: 'base/**'
229
230     builders:
231       - lf-infra-pre-build
232       - config-file-provider:
233           files:
234             - file-id: kni-coreos-pull-secret
235               target: akraino-secrets/coreos-pull-secret
236       - shell: !include-raw-escape:
237           - ../shell/install_go.sh
238       - shell: ./installer/ci/kni_deploy_gcp.sh {site}
239
240 - job-template:
241     id: kni-verify-deploy-gcp-hub
242     name: 'kni-{project-name}-verify-deploy-gcp'
243     site: kni-mgmt-hub.gcp.devcluster.openshift.com
244     build-node: kni-cloud
245     <<: *kni_common_deploy
246
247     gerrit_trigger_file_paths:
248       - compare-type: ANT
249         pattern: 'profiles/production.gcp/**'
250       - compare-type: ANT
251         pattern: 'sites/kni-mgmt-hub.gcp.devcluster.openshift.com/**'
252       - compare-type: ANT
253         pattern: 'base/**'
254
255     builders:
256       - lf-infra-pre-build
257       - config-file-provider:
258           files:
259             - file-id: kni-coreos-pull-secret
260               target: akraino-secrets/coreos-pull-secret
261       - shell: !include-raw-escape:
262           - ../shell/install_go.sh
263       - shell: ./installer/ci/kni_deploy_gcp.sh {site}
264
265 - job-template:
266     id: kni-verify-deploy-gcp-ie
267     name: 'kni-{project-name}-verify-deploy-gcp'
268     site: kni-ie.gcp.devcluster.openshift.com
269     build-node: kni-cloud
270     <<: *kni_common_deploy
271
272     gerrit_trigger_file_paths:
273       - compare-type: ANT
274         pattern: 'profiles/production.gcp/**'
275       - compare-type: ANT
276         pattern: 'sites/kni-ie.gcp.devcluster.openshift.com/**'
277       - compare-type: ANT
278         pattern: 'base/**'
279
280     builders:
281       - lf-infra-pre-build
282       - config-file-provider:
283           files:
284             - file-id: kni-coreos-pull-secret
285               target: akraino-secrets/coreos-pull-secret
286       - shell: !include-raw-escape:
287           - ../shell/install_go.sh
288       - shell: ./installer/ci/kni_deploy_gcp.sh {site}
289
290 - job-template:
291     id: kni-verify-deploy-baremetal
292     name: 'kni-{project-name}-verify-deploy-baremetal'
293     <<: *kni_common_deploy
294     build-timeout: 120
295     build-node: kni-baremetal
296
297     gerrit_trigger_file_paths:
298       - compare-type: ANT
299         pattern: 'profiles/production.baremetal/**'
300       - compare-type: ANT
301         pattern: 'sites/testing.baremetal.edge-sites.net/**'
302       - compare-type: ANT
303         pattern: 'base/**'
304
305     scm:
306       - akraino-lf-infra-gerrit-scm:
307           jenkins-ssh-credential: '{jenkins-ssh-credential}'
308           git-url: 'https://gerrit.akraino.org/r/kni/blueprint-pae'
309           refspec: '$GERRIT_REFSPEC'
310           branch: '$GERRIT_BRANCH'
311           submodule-recursive: '{submodule-recursive}'
312           submodule-timeout: '{submodule-timeout}'
313           submodule-disable: false
314           choosing-strategy: gerrit
315           basedir: 'kni-blueprint-pae'
316       - akraino-lf-infra-gerrit-scm:
317           jenkins-ssh-credential: '{jenkins-ssh-credential}'
318           git-url: '{git-url}/kni/installer.git'
319           refspec: 'refs/heads/master'
320           branch: 'master'
321           submodule-recursive: '{submodule-recursive}'
322           submodule-timeout: '{submodule-timeout}'
323           submodule-disable: false
324           choosing-strategy: default
325           basedir: 'installer'
326
327     builders:
328       - lf-infra-pre-build
329       - config-file-provider:
330           files:
331             - file-id: kni-coreos-pull-secret
332               target: akraino-secrets/coreos-pull-secret
333             - file-id: kni-ssh-pub-key
334               target: akraino-secrets/ssh-pub-key
335       - shell: sudo -E ./installer/ci/kni_deploy_baremetal.sh