add ccsdk-sli-northbound
[infra/cicd.git] / jjb / cloud-infra / kubernetes-jobs / kubernetes-verify-package.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
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,
13 # WITHOUT 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 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19
20 - project:
21     name: 'kubernetes-verify-package'
22
23     project: 'kubernetes-verify-package'
24
25     # NOTE (fdegir): dot is not an allowed character in groovy var names and also for
26     # naming openstack objects so stream is used for that purpose but branch points to
27     # actual branch name on gerrit
28     stream:
29       - 'master':
30           branch: 'master'
31           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
32           execution-mode: 'packaging'
33           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
34           successful: false
35           failed: false
36           unstable: false
37           notbuilt: false
38           deploy-scenario: 'k8-multus-plugins'
39       - '1_20':
40           branch: '1.20'
41           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
42           execution-mode: 'packaging'
43           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
44           successful: false
45           failed: false
46           unstable: false
47           notbuilt: false
48           deploy-scenario: 'k8-multus-plugins'
49       - '1_19':
50           branch: '1.19'
51           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
52           execution-mode: 'packaging'
53           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
54           successful: false
55           failed: false
56           unstable: false
57           notbuilt: false
58           deploy-scenario: 'k8-multus-plugins'
59       - '1_18':
60           branch: '1.18'
61           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
62           execution-mode: 'packaging'
63           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
64           successful: false
65           failed: false
66           unstable: false
67           notbuilt: false
68           deploy-scenario: 'k8-multus-plugins'
69       - '1_17':
70           branch: '1.17'
71           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
72           execution-mode: 'packaging'
73           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
74           successful: false
75           failed: false
76           unstable: false
77           notbuilt: false
78           deploy-scenario: 'k8-multus-plugins'
79       - '1_16':
80           branch: '1.16'
81           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
82           execution-mode: 'packaging'
83           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
84           successful: false
85           failed: false
86           unstable: false
87           notbuilt: false
88           deploy-scenario: 'k8-calico-nofeature'
89       - '1_15':
90           branch: '1.15'
91           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
92           execution-mode: 'packaging'
93           gated-projects: 'infra/stack/kubernetes|infra/installer/kubespray'
94           successful: false
95           failed: false
96           unstable: false
97           notbuilt: false
98           deploy-scenario: 'k8-calico-nofeature'
99
100     distro:
101       - ubuntu1804
102
103     dependency-jobs: 'kubernetes-verify-tox-{stream}'
104     dependency-job-var: 'TRIGGER_kubernetes_verify_tox_{stream}_BUILD_RESULT'
105
106     jobs:
107       - 'kubernetes-verify-package-{distro}-{stream}'
108
109 - job-template:
110     name: 'kubernetes-verify-package-{distro}-{stream}'
111
112     disabled: '{obj:disabled}'
113
114     concurrent: true
115
116     parameters:
117       - string:
118           name: DEPLOY_SCENARIO
119           default: '{deploy-scenario}'
120           description: 'Scenario to test change with.'
121       - string:
122           name: EXECUTION_MODE
123           default: '{execution-mode}'
124           description: 'Engine execution mode - packaging'
125       - string:
126           name: DISTRO
127           default: '{distro}'
128           description: 'Distribution to use for configuring target nodes (networking etc.)'
129       - string:
130           name: VERBOSITY
131           default: 'true'
132           description: 'Verbosity setting for the engine - true or false - default is false'
133       - string:
134           name: CI_LOOP
135           default: 'verify'
136           description: 'CI loop type'
137       - label:
138           name: SLAVE_LABEL
139           default: 'engine-package-{distro}-fra'
140           description: 'Slave label to schedule this job on.'
141       - project-parameters:
142           project: $GERRIT_PROJECT
143           branch: '{branch}'
144           description: 'The project and branch which the change is proposed for'
145       - nordix-gerrit-parameters
146
147     properties:
148       - logrotate
149       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
150       - throttle:
151           enabled: true
152           max-per-node: 1
153           max-total: 4
154           option: category
155           categories:
156             - engine-verify-package
157
158     scm:
159       - git-scm-gerrit:
160           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
161           branch: $GERRIT_BRANCH
162           refspec: $GERRIT_REFSPEC
163           wipe_workspace: true
164           clean_before: false
165
166     triggers:
167       - gerrit:
168           server-name: 'Nordix Gerrit'
169           trigger-on:
170             - patchset-created-event:
171                 exclude-drafts: 'false'
172                 exclude-trivial-rebase: 'false'
173                 exclude-no-code-change: 'false'
174             - draft-published-event
175             - comment-added-contains-event:
176                 comment-contains-value: 'recheck'
177             - comment-added-contains-event:
178                 comment-contains-value: 'reverify'
179           projects:
180             - project-compare-type: 'REG_EXP'
181               project-pattern: '{gated-projects}'
182               branches:
183                 - branch-compare-type: 'ANT'
184                   branch-pattern: '**/{branch}'
185               disable-strict-forbidden-file-verification: 'true'
186               forbidden-file-paths:
187                 - compare-type: ANT
188                   pattern: 'docs/**|releasenotes/**'
189           skip-vote:
190             successful: '{obj:successful}'
191             failed: '{obj:failed}'
192             unstable: '{obj:unstable}'
193             notbuilt: '{obj:notbuilt}'
194           custom-url: '* $JOB_NAME $BUILD_URL'
195           readable-message: 'true'
196           dependency-jobs: '{dependency-jobs}'
197
198     wrappers:
199       - openstack:
200           single-use: True
201       - build-timeout:
202           timeout: 240
203       - credentials-binding:
204           - username-password-separated:
205               credential-id: 'nordix-cicd-arm-credentials'
206               username: NORDIX_ARM_USERNAME
207               password: NORDIX_ARM_TOKEN
208       - mask-passwords
209       - pre-scm-buildstep:
210           failOnError: true
211           buildsteps:
212             - system-groovy:
213                 command: |
214                   def build = this.getProperty('binding').getVariable('build')
215                   def listener = this.getProperty('binding').getVariable('listener')
216                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
217                     println "WARN  : Aborting build since dependent job did not succeed!"
218                     throw new InterruptedException()
219                   }}
220             - shell: |
221                 #!/bin/bash
222                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
223       - ssh-agent-credentials:
224           users:
225             - 'nordixinfra-nordix-gerrit-ssh'
226
227
228     builders:
229       - 'generate-change-metadata-macro'
230       - inject:
231           properties-file: "$WORKSPACE/change.properties"
232       - 'generate-ssh-keypair-macro'
233       - 'wait-pkg-mgr-macro'
234       - 'package-macro'
235       - 'upload-artifact-macro'