Merge "[validation] Disable jobs for tag"
[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-libvirt
223     name: 'kni-{project-name}-verify-deploy-libvirt'
224     build-node: kni-libvirt
225     <<: *kni_common_deploy
226
227     gerrit_trigger_file_paths:
228       - compare-type: ANT
229         pattern: 'profiles/testing.libvirt/**'
230       - compare-type: ANT
231         pattern: 'sites/testing.virt.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             - file-id: kni-ssh-pub-key
242               target: akraino-secrets/ssh-pub-key
243       - shell: !include-raw-escape:
244           - ../shell/install_go.sh
245       - shell: ./installer/ci/kni_deploy_libvirt.sh
246
247 - job-template:
248     id: kni-verify-deploy-baremetal
249     name: 'kni-{project-name}-verify-deploy-baremetal'
250     <<: *kni_common_deploy
251     build-timeout: 120
252     build-node: kni-baremetal
253
254     gerrit_trigger_file_paths:
255       - compare-type: ANT
256         pattern: 'profiles/production.baremetal/**'
257       - compare-type: ANT
258         pattern: 'sites/testing.baremetal.edge-sites.net/**'
259       - compare-type: ANT
260         pattern: 'base/**'
261
262     scm:
263       - akraino-lf-infra-gerrit-scm:
264           jenkins-ssh-credential: '{jenkins-ssh-credential}'
265           git-url: 'https://github.com/yrobla/testing.baremetal.edge-sites.net'
266           refspec: '$GERRIT_REFSPEC'
267           branch: '$GERRIT_BRANCH'
268           submodule-recursive: '{submodule-recursive}'
269           submodule-timeout: '{submodule-timeout}'
270           submodule-disable: false
271           choosing-strategy: default
272           basedir: 'testing.baremetal.edge-sites.net'
273       - akraino-lf-infra-gerrit-scm:
274           jenkins-ssh-credential: '{jenkins-ssh-credential}'
275           git-url: '{git-url}/kni/installer.git'
276           refspec: 'refs/heads/master'
277           branch: 'master'
278           submodule-recursive: '{submodule-recursive}'
279           submodule-timeout: '{submodule-timeout}'
280           submodule-disable: false
281           choosing-strategy: default
282           basedir: 'installer'
283
284     builders:
285       - lf-infra-pre-build
286       - config-file-provider:
287           files:
288             - file-id: kni-coreos-pull-secret
289               target: akraino-secrets/coreos-pull-secret
290             - file-id: kni-ssh-pub-key
291               target: akraino-secrets/ssh-pub-key
292       - shell: sudo -E ./installer/ci/kni_deploy_baremetal.sh