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