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