engine: Create jobs for Kubernetes 1.18
[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_18':
40           branch: '1.18'
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_17':
50           branch: '1.17'
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_16':
60           branch: '1.16'
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-calico-nofeature'
69       - '1_15':
70           branch: '1.15'
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-calico-nofeature'
79
80     distro:
81       - ubuntu1804
82
83     dependency-jobs: 'kubernetes-verify-tox-{stream}'
84     dependency-job-var: 'TRIGGER_kubernetes_verify_tox_{stream}_BUILD_RESULT'
85
86     jobs:
87       - 'kubernetes-verify-package-{distro}-{stream}'
88
89 - job-template:
90     name: 'kubernetes-verify-package-{distro}-{stream}'
91
92     disabled: '{obj:disabled}'
93
94     concurrent: true
95
96     parameters:
97       - string:
98           name: DEPLOY_SCENARIO
99           default: '{deploy-scenario}'
100           description: 'Scenario to test change with.'
101       - string:
102           name: EXECUTION_MODE
103           default: '{execution-mode}'
104           description: 'Engine execution mode - packaging'
105       - string:
106           name: DISTRO
107           default: '{distro}'
108           description: 'Distribution to use for configuring target nodes (networking etc.)'
109       - string:
110           name: VERBOSITY
111           default: 'true'
112           description: 'Verbosity setting for the engine - true or false - default is false'
113       - string:
114           name: CI_LOOP
115           default: 'verify'
116           description: 'CI loop type'
117       - label:
118           name: SLAVE_LABEL
119           default: 'engine-package-{distro}-fra'
120           description: 'Slave label to schedule this job on.'
121       - project-parameters:
122           project: $GERRIT_PROJECT
123           branch: '{branch}'
124           description: 'The project and branch which the change is proposed for'
125       - nordix-gerrit-parameters
126
127     properties:
128       - logrotate
129       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
130       - throttle:
131           enabled: true
132           max-per-node: 1
133           max-total: 4
134           option: category
135           categories:
136             - engine-verify-package
137
138     scm:
139       - git-scm-gerrit:
140           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
141           branch: $GERRIT_BRANCH
142           refspec: $GERRIT_REFSPEC
143           wipe_workspace: true
144           clean_before: false
145
146     triggers:
147       - gerrit:
148           server-name: 'Nordix Gerrit'
149           trigger-on:
150             - patchset-created-event:
151                 exclude-drafts: 'false'
152                 exclude-trivial-rebase: 'false'
153                 exclude-no-code-change: 'false'
154             - draft-published-event
155             - comment-added-contains-event:
156                 comment-contains-value: 'recheck'
157             - comment-added-contains-event:
158                 comment-contains-value: 'reverify'
159           projects:
160             - project-compare-type: 'REG_EXP'
161               project-pattern: '{gated-projects}'
162               branches:
163                 - branch-compare-type: 'ANT'
164                   branch-pattern: '**/{branch}'
165               disable-strict-forbidden-file-verification: 'true'
166               forbidden-file-paths:
167                 - compare-type: ANT
168                   pattern: 'docs/**|releasenotes/**'
169           skip-vote:
170             successful: '{obj:successful}'
171             failed: '{obj:failed}'
172             unstable: '{obj:unstable}'
173             notbuilt: '{obj:notbuilt}'
174           custom-url: '* $JOB_NAME $BUILD_URL'
175           readable-message: 'true'
176           dependency-jobs: '{dependency-jobs}'
177
178     wrappers:
179       - openstack:
180           single-use: True
181       - build-timeout:
182           timeout: 240
183       - credentials-binding:
184           - username-password-separated:
185               credential-id: 'nordix-cicd-arm-credentials'
186               username: NORDIX_ARM_USERNAME
187               password: NORDIX_ARM_TOKEN
188       - mask-passwords
189       - pre-scm-buildstep:
190           failOnError: true
191           buildsteps:
192             - system-groovy:
193                 command: |
194                   def build = this.getProperty('binding').getVariable('build')
195                   def listener = this.getProperty('binding').getVariable('listener')
196                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
197                     println "WARN  : Aborting build since dependent job did not succeed!"
198                     throw new InterruptedException()
199                   }}
200             - shell: |
201                 #!/bin/bash
202                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
203
204
205     builders:
206       - 'generate-change-metadata-macro'
207       - inject:
208           properties-file: "$WORKSPACE/change.properties"
209       - 'generate-ssh-keypair-macro'
210       - 'wait-pkg-mgr-macro'
211       - 'package-macro'
212       - 'upload-artifact-macro'