engine: Set deploy scenario and create k8s 1.16 jobs
[infra/cicd.git] / jjb / engine / verify-jobs / openstack-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: 'openstack-verify-package'
22
23     project: 'openstack-verify-package'
24
25     stream:
26       - 'master':
27           branch: '{stream}'
28           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
29           execution-mode: 'packaging'
30           gated-projects: 'infra/stack/openstack|infra/installer/kolla'
31           successful: false
32           failed: false
33           unstable: false
34           notbuilt: false
35           deploy-scenario: 'os-nosdn-nofeature'
36       - 'train':
37           branch: '{stream}'
38           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
39           execution-mode: 'packaging'
40           gated-projects: 'infra/stack/openstack|infra/installer/kolla'
41           successful: false
42           failed: false
43           unstable: false
44           notbuilt: false
45           deploy-scenario: 'os-nosdn-nofeature'
46       - 'stein':
47           branch: '{stream}'
48           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
49           execution-mode: 'packaging'
50           gated-projects: 'infra/stack/openstack|infra/installer/kolla'
51           successful: false
52           failed: false
53           unstable: false
54           notbuilt: false
55           deploy-scenario: 'os-nosdn-nofeature'
56
57     distro:
58       - ubuntu1804
59
60     dependency-jobs: 'openstack-verify-tox-{stream}'
61     dependency-job-var: 'TRIGGER_openstack_verify_tox_{stream}_BUILD_RESULT'
62
63     jobs:
64       - 'openstack-verify-package-{distro}-{stream}'
65
66 - job-template:
67     name: 'openstack-verify-package-{distro}-{stream}'
68
69     disabled: '{obj:disabled}'
70
71     concurrent: true
72
73     parameters:
74       - string:
75           name: DEPLOY_SCENARIO
76           default: '{deploy-scenario}'
77           description: 'Scenario to test change with.'
78       - string:
79           name: EXECUTION_MODE
80           default: '{execution-mode}'
81           description: 'Engine execution mode - packaging'
82       - string:
83           name: DISTRO
84           default: '{distro}'
85           description: 'Distribution to use for configuring target nodes (networking etc.)'
86       - string:
87           name: VERBOSITY
88           default: 'true'
89           description: 'Verbosity setting for the engine - true or false - default is false'
90       - string:
91           name: CI_LOOP
92           default: 'verify'
93           description: 'CI loop type'
94       - label:
95           name: SLAVE_LABEL
96           default: 'engine-package-{distro}-fra'
97           description: 'Slave label to schedule this job on.'
98       - project-parameters:
99           project: $GERRIT_PROJECT
100           branch: '{branch}'
101           description: 'The project and branch which the change is proposed for'
102       - nordix-gerrit-parameters
103
104     properties:
105       - logrotate
106       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
107       - throttle:
108           enabled: true
109           max-per-node: 1
110           max-total: 4
111           option: category
112           categories:
113             - engine-verify-package
114
115     scm:
116       - git-scm-gerrit:
117           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
118           branch: $GERRIT_BRANCH
119           refspec: $GERRIT_REFSPEC
120           wipe_workspace: true
121           clean_before: false
122
123     triggers:
124       - gerrit:
125           server-name: 'Nordix Gerrit'
126           trigger-on:
127             - patchset-created-event:
128                 exclude-drafts: 'false'
129                 exclude-trivial-rebase: 'false'
130                 exclude-no-code-change: 'false'
131             - draft-published-event
132             - comment-added-contains-event:
133                 comment-contains-value: 'recheck'
134             - comment-added-contains-event:
135                 comment-contains-value: 'reverify'
136           projects:
137             - project-compare-type: 'REG_EXP'
138               project-pattern: '{gated-projects}'
139               branches:
140                 - branch-compare-type: 'ANT'
141                   branch-pattern: '**/{branch}'
142               disable-strict-forbidden-file-verification: 'true'
143               forbidden-file-paths:
144                 - compare-type: ANT
145                   pattern: 'docs/**|releasenotes/**'
146           skip-vote:
147             successful: '{obj:successful}'
148             failed: '{obj:failed}'
149             unstable: '{obj:unstable}'
150             notbuilt: '{obj:notbuilt}'
151           custom-url: '* $JOB_NAME $BUILD_URL'
152           readable-message: 'true'
153           dependency-jobs: '{dependency-jobs}'
154
155     wrappers:
156       - openstack:
157           single-use: True
158       - build-timeout:
159           timeout: 240
160       - credentials-binding:
161           - username-password-separated:
162               credential-id: 'nordix-cicd-arm-credentials'
163               username: NORDIX_ARM_USERNAME
164               password: NORDIX_ARM_TOKEN
165       - mask-passwords
166       - pre-scm-buildstep:
167           failOnError: true
168           buildsteps:
169             - system-groovy:
170                 command: |
171                   def build = this.getProperty('binding').getVariable('build')
172                   def listener = this.getProperty('binding').getVariable('listener')
173                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
174                     println "WARN  : Aborting build since dependent job did not succeed!"
175                     throw new InterruptedException()
176                   }}
177             - shell: |
178                 #!/bin/bash
179                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
180
181
182     builders:
183       - 'generate-change-metadata-macro'
184       - inject:
185           properties-file: "$WORKSPACE/change.properties"
186       - 'generate-ssh-keypair-macro'
187       - 'wait-pkg-mgr-macro'
188       - 'package-macro'
189       - 'upload-artifact-macro'