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