Merge "Fix k8s tests run in CI"
[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 - kni_common: &kni_common
18     name: kni-common
19
20     ######################
21     # Default parameters #
22     ######################
23
24     build-node: "{build-node}"
25     build-days-to-keep: 30
26     build-timeout: 60
27     submodule-recursive: true
28     gerrit_trigger_file_paths: "{obj:gerrit_trigger_file_paths}"
29
30     #####################
31     # Job Configuration #
32     #####################
33
34     project-type: freestyle
35     node: "{build-node}"
36     properties:
37       - lf-infra-properties:
38           build-days-to-keep: '{build-days-to-keep}'
39
40     parameters:
41       - lf-infra-parameters:
42           project: '{project}'
43           branch: '{branch}'
44           stream: '{stream}'
45           lftools-version: '{lftools-version}'
46
47     wrappers:
48       - lf-infra-wrappers:
49           build-timeout: '{build-timeout}'
50           jenkins-ssh-credential: '{jenkins-ssh-credential}'
51
52     scm:
53       - lf-infra-gerrit-scm:
54           jenkins-ssh-credential: '{jenkins-ssh-credential}'
55           git-url: '{git-url}/{project}.git'
56           refspec: '$GERRIT_REFSPEC'
57           branch: '$GERRIT_BRANCH'
58           submodule-recursive: '{submodule-recursive}'
59           submodule-timeout: '{submodule-timeout}'
60           submodule-disable: false
61           choosing-strategy: default
62
63     gerrit_verify_triggers:
64       - patchset-created-event:
65           exclude-drafts: true
66           exclude-trivial-rebase: false
67           exclude-no-code-change: false
68       - draft-published-event
69       - comment-added-contains-event:
70           comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(recheck|reverify)$'
71
72     triggers:
73       - gerrit:
74           server-name: '{gerrit-server-name}'
75           trigger-on: '{obj:gerrit_verify_triggers}'
76           projects:
77             - project-compare-type: ANT
78               project-pattern: '{project}'
79               branches:
80                 - branch-compare-type: ANT
81                   branch-pattern: '**/{branch}'
82               file-paths: '{obj:gerrit_trigger_file_paths}'
83     publishers:
84       - lf-infra-publish
85
86 - kni_common_deploy: &kni_common_deploy
87     name: kni-common-deploy
88     <<: *kni_common
89     archive-artifacts: >
90       **/*.log
91
92     parameters:
93       - lf-infra-parameters:
94           project: '{project}'
95           branch: '{branch}'
96           stream: '{stream}'
97           lftools-version: '{lftools-version}'
98       - string:
99           name: ARCHIVE_ARTIFACTS
100           default: '{archive-artifacts}'
101           description: Artifacts to archive to the logs server.
102
103     wrappers:
104       - lf-infra-wrappers:
105           build-timeout: '{build-timeout}'
106           jenkins-ssh-credential: '{jenkins-ssh-credential}'
107       - credentials-binding:
108           - ssh-user-private-key:
109               credential-id: kni-secrets
110               key-file-variable: KNI_KEY_PATH
111     scm:
112       - akraino-lf-infra-gerrit-scm:
113           jenkins-ssh-credential: '{jenkins-ssh-credential}'
114           git-url: '{git-url}/{project}.git'
115           refspec: '$GERRIT_REFSPEC'
116           branch: '$GERRIT_BRANCH'
117           submodule-recursive: '{submodule-recursive}'
118           submodule-timeout: '{submodule-timeout}'
119           submodule-disable: false
120           choosing-strategy: default
121           basedir: '{project-name}'
122       - akraino-lf-infra-gerrit-scm:
123           jenkins-ssh-credential: '{jenkins-ssh-credential}'
124           git-url: '{git-url}/kni/installer.git'
125           refspec: 'refs/heads/master'
126           branch: 'master'
127           submodule-recursive: '{submodule-recursive}'
128           submodule-timeout: '{submodule-timeout}'
129           submodule-disable: false
130           choosing-strategy: default
131           basedir: 'installer'
132
133 - job-template:
134     id: kni-installer-verify-installer
135     name: '{project-name}-verify-installer'
136     gerrit_trigger_file_paths:
137       - compare-type: ANT
138         pattern: '**'
139     <<: *kni_common
140     build-node: centos7-builder-2c-1g
141
142     builders:
143       - lf-infra-pre-build
144       - shell: !include-raw-escape:
145           - ../shell/install_go.sh
146       - shell: !include-raw-escape:
147           - ../shell/build_kni_installer.sh
148
149 - job-template:
150     id: kni-installer-verify-binary
151     name: '{project-name}-verify-binary'
152     <<: *kni_common
153     build-node: centos7-builder-8c-8g
154
155     gerrit_trigger_file_paths:
156       - compare-type: ANT
157         pattern: 'Makefile'
158       - compare-type: ANT
159         pattern: 'cmd/binary.go'
160
161     triggers:
162       - gerrit:
163           server-name: '{gerrit-server-name}'
164           trigger-on: '{obj:gerrit_verify_triggers}'
165           projects:
166             - project-compare-type: ANT
167               project-pattern: '{project}'
168               branches:
169                 - branch-compare-type: ANT
170                   branch-pattern: '**/{branch}'
171               file-paths: '{obj:gerrit_trigger_file_paths}'
172
173     builders:
174       - lf-infra-pre-build
175       - shell: !include-raw-escape:
176           - ../shell/install_go.sh
177       - shell: !include-raw-escape:
178           - ../shell/build_kni_binary.sh
179
180 - job-template:
181     id: kni-installer-publish-openshift-install-libvirt-binary
182     name: '{project-name}-publish-openshift-install-libvirt-binary'
183     <<: *kni_common
184     build-node: centos7-builder-8c-8g
185
186     gerrit_trigger_file_paths: []
187     gerrit_build_triggers:
188       - comment-added-contains-event:
189           comment-contains-value: '^build-binary'
190     builders:
191       - lf-infra-pre-build
192       - shell: !include-raw-escape:
193           - ../shell/install_go.sh
194       - shell: !include-raw-escape:
195           - ../shell/build_openshift_install_libvirt_binary.sh
196
197 - job-template:
198     id: kni-verify-deploy-aws
199     name: 'kni-{project-name}-verify-deploy-aws'
200     build-node: kni-libvirt
201     <<: *kni_common_deploy
202
203     gerrit_trigger_file_paths:
204       - compare-type: ANT
205         pattern: 'profiles/production.aws/**'
206       - compare-type: ANT
207         pattern: 'sites/testing.aws.edge-sites.net/**'
208       - compare-type: ANT
209         pattern: 'base/**'
210
211     builders:
212       - lf-infra-pre-build
213       - config-file-provider:
214           files:
215             - file-id: kni-coreos-pull-secret
216               target: akraino-secrets/coreos-pull-secret
217       - shell: !include-raw-escape:
218           - ../shell/install_go.sh
219       - shell: ./installer/ci/kni_deploy_aws.sh
220
221 - job-template:
222     id: kni-verify-deploy-gcp
223     name: 'kni-{project-name}-verify-deploy-gcp'
224     build-node: kni-libvirt
225     <<: *kni_common_deploy
226
227     gerrit_trigger_file_paths:
228       - compare-type: ANT
229         pattern: 'profiles/production.gcp/**'
230       - compare-type: ANT
231         pattern: 'sites/testing.gcp.edge-sites.net/**'
232       - compare-type: ANT
233         pattern: 'base/**'
234
235     builders:
236       - lf-infra-pre-build
237       - config-file-provider:
238           files:
239             - file-id: kni-coreos-pull-secret
240               target: akraino-secrets/coreos-pull-secret
241       - shell: !include-raw-escape:
242           - ../shell/install_go.sh
243       - shell: ./installer/ci/kni_deploy_gcp.sh
244
245 - job-template:
246     id: kni-verify-deploy-libvirt
247     name: 'kni-{project-name}-verify-deploy-libvirt'
248     build-node: kni-libvirt
249     build-timeout: 120
250     <<: *kni_common_deploy
251
252     gerrit_trigger_file_paths:
253       - compare-type: ANT
254         pattern: 'profiles/testing.libvirt/**'
255       - compare-type: ANT
256         pattern: 'sites/testing.virt.edge-sites.net/**'
257       - compare-type: ANT
258         pattern: 'base/**'
259
260     builders:
261       - lf-infra-pre-build
262       - config-file-provider:
263           files:
264             - file-id: kni-coreos-pull-secret
265               target: akraino-secrets/coreos-pull-secret
266             - file-id: kni-ssh-pub-key
267               target: akraino-secrets/ssh-pub-key
268       - shell: !include-raw-escape:
269           - ../shell/install_go.sh
270       - shell: ./installer/ci/kni_deploy_libvirt.sh
271
272 - job-template:
273     id: kni-verify-deploy-baremetal
274     name: 'kni-{project-name}-verify-deploy-baremetal'
275     <<: *kni_common_deploy
276     build-timeout: 120
277     build-node: kni-libvirt
278
279     gerrit_trigger_file_paths:
280       - compare-type: ANT
281         pattern: 'profiles/production.baremetal/**'
282       - compare-type: ANT
283         pattern: 'sites/testing.baremetal.edge-sites.net/**'
284       - compare-type: ANT
285         pattern: 'base/**'
286
287     scm:
288       - akraino-lf-infra-gerrit-scm:
289           jenkins-ssh-credential: '{jenkins-ssh-credential}'
290           git-url: 'https://github.com/akraino-edge-stack/kni-blueprint-pae'
291           refspec: '$GERRIT_REFSPEC'
292           branch: '$GERRIT_BRANCH'
293           submodule-recursive: '{submodule-recursive}'
294           submodule-timeout: '{submodule-timeout}'
295           submodule-disable: false
296           choosing-strategy: default
297           basedir: 'kni-blueprint-pae'
298       - akraino-lf-infra-gerrit-scm:
299           jenkins-ssh-credential: '{jenkins-ssh-credential}'
300           git-url: '{git-url}/kni/installer.git'
301           refspec: 'refs/heads/master'
302           branch: 'master'
303           submodule-recursive: '{submodule-recursive}'
304           submodule-timeout: '{submodule-timeout}'
305           submodule-disable: false
306           choosing-strategy: default
307           basedir: 'installer'
308
309     builders:
310       - lf-infra-pre-build
311       - config-file-provider:
312           files:
313             - file-id: kni-coreos-pull-secret
314               target: akraino-secrets/coreos-pull-secret
315             - file-id: kni-ssh-pub-key
316               target: akraino-secrets/ssh-pub-key
317       - shell: sudo -E ./installer/ci/kni_deploy_baremetal.sh