Update onap verify jobs
[infra/cicd.git] / jjb / cloud-infra / onap-jobs / onap-verify-package.yaml
1 ---
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2021 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: 'onap-verify-package'
22
23     project: 'onap-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           container-tool: 'docker'
31           gated-projects: 'infra/stack/onap|infra/installer/oom'
32           successful: false
33           failed: false
34           unstable: false
35           notbuilt: false
36           deploy-scenario: 'onap-full-nofeature'
37       - 'guilin':
38           branch: '{stream}'
39           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
40           execution-mode: 'packaging'
41           container-tool: 'docker'
42           gated-projects: 'infra/stack/onap|infra/installer/oom'
43           successful: false
44           failed: false
45           unstable: false
46           notbuilt: false
47           deploy-scenario: 'onap-full-nofeature'
48       - 'frankfurt':
49           branch: '{stream}'
50           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
51           execution-mode: 'packaging'
52           container-tool: 'docker'
53           gated-projects: 'infra/stack/onap|infra/installer/oom'
54           successful: false
55           failed: false
56           unstable: false
57           notbuilt: false
58           deploy-scenario: 'onap-full-nofeature'
59       - 'elalto':
60           branch: '{stream}'
61           openrc-credentials-file: 'est-jenkins-openrcfile-city-frankfurt-cicd'
62           execution-mode: 'packaging'
63           container-tool: 'docker'
64           gated-projects: 'infra/stack/onap|infra/installer/oom'
65           successful: false
66           failed: false
67           unstable: false
68           notbuilt: false
69           deploy-scenario: 'onap-full-nofeature'
70     distro:
71       - ubuntu1804
72
73     dependency-jobs: 'onap-verify-tox-{stream}'
74     dependency-job-var: 'TRIGGER_onap_verify_tox_{stream}_BUILD_RESULT'
75
76     jobs:
77       - 'onap-verify-package-{distro}-{stream}'
78       - 'onap-verify-packaging-{distro}-{stream}'
79       - 'onap-verify-test-packaging-{distro}-{stream}'
80
81 - job-template:
82     name: 'onap-verify-package-{distro}-{stream}'
83
84     project-type: multijob
85
86     disabled: '{obj:disabled}'
87
88     concurrent: true
89
90     parameters:
91       - string:
92           name: DEPLOY_SCENARIO
93           default: '{deploy-scenario}'
94           description: 'Scenario to test change with.'
95       - string:
96           name: CONTAINER_TOOL
97           default: '{container-tool}'
98           description: 'Command to use when pulling images. Options docker or podman'
99       - string:
100           name: DISTRO
101           default: '{distro}'
102           description: 'Distribution to use for configuring target nodes (networking etc.)'
103       - string:
104           name: VERBOSITY
105           default: 'true'
106           description: 'Verbosity setting for the engine - true or false - default is false'
107       - string:
108           name: CI_LOOP
109           default: 'verify'
110           description: 'CI loop type'
111       - label:
112           name: SLAVE_LABEL
113           default: 'engine-package-{distro}-fra'
114           description: 'Slave label to schedule this job on.'
115       - project-parameters:
116           project: $GERRIT_PROJECT
117           branch: '{branch}'
118           description: 'The project and branch which the change is proposed for'
119       - nordix-gerrit-parameters
120
121     properties:
122       - logrotate
123       # NOTE (fdegir): throttle categories are controlled in jenkins global configuration
124       - throttle:
125           enabled: true
126           max-per-node: 1
127           max-total: 4
128           option: category
129           categories:
130             - engine-verify-package
131
132     scm:
133       - git-scm-gerrit:
134           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
135           branch: $GERRIT_BRANCH
136           refspec: $GERRIT_REFSPEC
137           wipe_workspace: true
138           clean_before: false
139
140     triggers:
141       - gerrit:
142           server-name: 'Nordix Gerrit'
143           trigger-on:
144             - patchset-created-event:
145                 exclude-drafts: 'false'
146                 exclude-trivial-rebase: 'false'
147                 exclude-no-code-change: 'false'
148             - draft-published-event
149             - comment-added-contains-event:
150                 comment-contains-value: 'recheck'
151             - comment-added-contains-event:
152                 comment-contains-value: 'reverify'
153           projects:
154             - project-compare-type: 'REG_EXP'
155               project-pattern: '{gated-projects}'
156               branches:
157                 - branch-compare-type: 'ANT'
158                   branch-pattern: '**/{branch}'
159               disable-strict-forbidden-file-verification: 'true'
160               forbidden-file-paths:
161                 - compare-type: ANT
162                   pattern: 'docs/**|releasenotes/**'
163           skip-vote:
164             successful: '{obj:successful}'
165             failed: '{obj:failed}'
166             unstable: '{obj:unstable}'
167             notbuilt: '{obj:notbuilt}'
168           custom-url: '* $JOB_NAME $BUILD_URL'
169           readable-message: 'true'
170           dependency-jobs: '{dependency-jobs}'
171
172     wrappers:
173       - openstack:
174           single-use: True
175       - build-timeout:
176           timeout: 300
177       - ssh-agent-credentials:
178           users:
179             - 'nordixinfra-nordix-gerrit-ssh'
180       - credentials-binding:
181           - username-password-separated:
182               credential-id: 'nordix-cicd-arm-credentials'
183               username: NORDIX_ARM_USERNAME
184               password: NORDIX_ARM_TOKEN
185       - mask-passwords
186       - pre-scm-buildstep:
187           failOnError: true
188           buildsteps:
189             - system-groovy:
190                 command: |
191                   def build = this.getProperty('binding').getVariable('build')
192                   def listener = this.getProperty('binding').getVariable('listener')
193                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
194                     println "WARN  : Aborting build since dependent job did not succeed!"
195                     throw new InterruptedException()
196                   }}
197             - shell: |
198                 #!/bin/bash
199                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
200
201     builders:
202       - 'generate-change-metadata-macro'
203       - inject:
204           properties-file: "$WORKSPACE/change.properties"
205       - 'generate-ssh-keypair-macro'
206       - 'wait-pkg-mgr-macro'
207       - multijob:
208           name: ONAP Framework Packaging
209           condition: SUCCESSFUL
210           execution-type: SEQUENTIALLY
211           projects:
212             - name: 'onap-verify-packaging-{distro}-{stream}'
213               current-parameters: true
214               git-revision: true
215               node-parameters: true
216               property-file: "$WORKSPACE/change.properties"
217               kill-phase-on: FAILURE
218               abort-all-job: true
219       - multijob:
220           name: Test Framework Packaging
221           condition: SUCCESSFUL
222           execution-type: SEQUENTIALLY
223           projects:
224             - name: 'onap-verify-test-packaging-{distro}-{stream}'
225               current-parameters: true
226               git-revision: true
227               node-parameters: true
228               property-file: "$WORKSPACE/change.properties"
229               kill-phase-on: FAILURE
230               abort-all-job: true
231
232 - job-template:
233     name: 'onap-verify-packaging-{distro}-{stream}'
234
235     disabled: '{obj:disabled}'
236
237     concurrent: false
238
239     parameters:
240       - string:
241           name: EXECUTION_MODE
242           default: 'packaging'
243           description: 'Execution mode to run engine'
244
245     properties:
246       - logrotate
247
248     wrappers:
249       - build-timeout:
250           timeout: 300
251       - credentials-binding:
252           - username-password-separated:
253               credential-id: 'nordix-cicd-arm-credentials'
254               username: NORDIX_ARM_USERNAME
255               password: NORDIX_ARM_TOKEN
256       - mask-passwords
257       - fix-workspace-permissions
258
259     scm:
260       - git-scm-gerrit:
261             ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
262             branch: $GERRIT_BRANCH
263             refspec: $GERRIT_REFSPEC
264             wipe_workspace: true
265             clean_before: false
266
267     builders:
268       - 'package-macro'
269       - 'upload-artifact-macro'
270
271 - job-template:
272     name: 'onap-verify-test-packaging-{distro}-{stream}'
273
274     disabled: '{obj:disabled}'
275
276     concurrent: false
277
278     parameters:
279       - string:
280           name: EXECUTION_MODE
281           default: 'packaging'
282           description: 'Execution mode to run engine'
283
284     properties:
285       - logrotate
286
287     wrappers:
288       - build-timeout:
289           timeout: 30
290       - credentials-binding:
291           - username-password-separated:
292               credential-id: 'nordix-cicd-arm-credentials'
293               username: NORDIX_ARM_USERNAME
294               password: NORDIX_ARM_TOKEN
295       - mask-passwords
296       - fix-workspace-permissions
297
298     builders:
299       - 'test-package-macro'
300       - 'xtesting-upload-artifact-macro'