aacb6e773186302c931f0c0e47d2be7c733a457f
[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-verify-deploy-aws
151     name: 'kni-{project-name}-verify-deploy-aws'
152     build-node: kni-job
153     <<: *kni_common_deploy
154
155     gerrit_trigger_file_paths:
156       - compare-type: ANT
157         pattern: 'profiles/production.aws/**'
158       - compare-type: ANT
159         pattern: 'sites/testing.aws.edge-sites.net/**'
160       - compare-type: ANT
161         pattern: 'base/**'
162
163     builders:
164       - lf-infra-pre-build
165       - config-file-provider:
166           files:
167             - file-id: kni-coreos-pull-secret
168               target: akraino-secrets/coreos-pull-secret
169       - shell: !include-raw-escape:
170           - ../shell/install_go.sh
171       - shell: ./installer/ci/kni_deploy_aws.sh
172
173 - job-template:
174     id: kni-verify-deploy-gcp
175     name: 'kni-{project-name}-verify-deploy-gcp'
176     build-node: kni-job
177     <<: *kni_common_deploy
178
179     gerrit_trigger_file_paths:
180       - compare-type: ANT
181         pattern: 'profiles/production.gcp/**'
182       - compare-type: ANT
183         pattern: 'sites/testing.gcp.edge-sites.net/**'
184       - compare-type: ANT
185         pattern: 'base/**'
186
187     builders:
188       - lf-infra-pre-build
189       - config-file-provider:
190           files:
191             - file-id: kni-coreos-pull-secret
192               target: akraino-secrets/coreos-pull-secret
193       - shell: !include-raw-escape:
194           - ../shell/install_go.sh
195       - shell: ./installer/ci/kni_deploy_gcp.sh
196
197 - job-template:
198     id: kni-verify-deploy-baremetal
199     name: 'kni-{project-name}-verify-deploy-baremetal'
200     <<: *kni_common_deploy
201     build-timeout: 120
202     build-node: kni-job
203
204     gerrit_trigger_file_paths:
205       - compare-type: ANT
206         pattern: 'profiles/production.baremetal/**'
207       - compare-type: ANT
208         pattern: 'sites/testing.baremetal.edge-sites.net/**'
209       - compare-type: ANT
210         pattern: 'base/**'
211
212     scm:
213       - akraino-lf-infra-gerrit-scm:
214           jenkins-ssh-credential: '{jenkins-ssh-credential}'
215           git-url: 'https://gerrit.akraino.org/r/kni/blueprint-pae'
216           refspec: '$GERRIT_REFSPEC'
217           branch: '$GERRIT_BRANCH'
218           submodule-recursive: '{submodule-recursive}'
219           submodule-timeout: '{submodule-timeout}'
220           submodule-disable: false
221           choosing-strategy: default
222           basedir: 'kni-blueprint-pae'
223       - akraino-lf-infra-gerrit-scm:
224           jenkins-ssh-credential: '{jenkins-ssh-credential}'
225           git-url: '{git-url}/kni/installer.git'
226           refspec: 'refs/heads/master'
227           branch: 'master'
228           submodule-recursive: '{submodule-recursive}'
229           submodule-timeout: '{submodule-timeout}'
230           submodule-disable: false
231           choosing-strategy: default
232           basedir: 'installer'
233
234     builders:
235       - lf-infra-pre-build
236       - config-file-provider:
237           files:
238             - file-id: kni-coreos-pull-secret
239               target: akraino-secrets/coreos-pull-secret
240             - file-id: kni-ssh-pub-key
241               target: akraino-secrets/ssh-pub-key
242       - shell: sudo -E ./installer/ci/kni_deploy_baremetal.sh