JIRA: AEGIS-458 Create xtesting package job for onap-verify
[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       - credentials-binding:
178           - username-password-separated:
179               credential-id: 'nordix-cicd-arm-credentials'
180               username: NORDIX_ARM_USERNAME
181               password: NORDIX_ARM_TOKEN
182       - mask-passwords
183       - pre-scm-buildstep:
184           failOnError: true
185           buildsteps:
186             - system-groovy:
187                 command: |
188                   def build = this.getProperty('binding').getVariable('build')
189                   def listener = this.getProperty('binding').getVariable('listener')
190                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
191                     println "WARN  : Aborting build since dependent job did not succeed!"
192                     throw new InterruptedException()
193                   }}
194             - shell: |
195                 #!/bin/bash
196                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
197
198     builders:
199       - 'generate-change-metadata-macro'
200       - inject:
201           properties-file: "$WORKSPACE/change.properties"
202       - 'generate-ssh-keypair-macro'
203       - 'wait-pkg-mgr-macro'
204       - multijob:
205           name: ONAP Framework Packaging
206           condition: SUCCESSFUL
207           execution-type: SEQUENTIALLY
208           projects:
209             - name: 'onap-verify-packaging-{distro}-{stream}'
210               current-parameters: true
211               git-revision: true
212               node-parameters: true
213               property-file: "$WORKSPACE/change.properties"
214               kill-phase-on: FAILURE
215               abort-all-job: true
216       - multijob:
217           name: Test Framework Packaging
218           condition: SUCCESSFUL
219           execution-type: SEQUENTIALLY
220           projects:
221             - name: 'onap-verify-test-packaging-{distro}-{stream}'
222               current-parameters: true
223               git-revision: true
224               node-parameters: true
225               property-file: "$WORKSPACE/change.properties"
226               kill-phase-on: FAILURE
227               abort-all-job: true
228
229 - job-template:
230     name: 'onap-verify-packaging-{distro}-{stream}'
231
232     disabled: '{obj:disabled}'
233
234     concurrent: false
235
236     parameters:
237       - string:
238           name: EXECUTION_MODE
239           default: 'packaging'
240           description: 'Execution mode to run engine'
241
242     properties:
243       - logrotate
244
245     wrappers:
246       - build-timeout:
247           timeout: 300
248       - credentials-binding:
249           - username-password-separated:
250               credential-id: 'nordix-cicd-arm-credentials'
251               username: NORDIX_ARM_USERNAME
252               password: NORDIX_ARM_TOKEN
253       - mask-passwords
254       - fix-workspace-permissions
255
256     scm:
257       - git-scm-gerrit:
258             ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
259             branch: $GERRIT_BRANCH
260             refspec: $GERRIT_REFSPEC
261             wipe_workspace: true
262             clean_before: false
263
264     builders:
265       - 'package-macro'
266       - 'upload-artifact-macro'
267
268 - job-template:
269     name: 'onap-verify-test-packaging-{distro}-{stream}'
270
271     disabled: '{obj:disabled}'
272
273     concurrent: false
274
275     parameters:
276       - string:
277           name: EXECUTION_MODE
278           default: 'packaging'
279           description: 'Execution mode to run engine'
280
281     properties:
282       - logrotate
283
284     wrappers:
285       - build-timeout:
286           timeout: 30
287       - credentials-binding:
288           - username-password-separated:
289               credential-id: 'nordix-cicd-arm-credentials'
290               username: NORDIX_ARM_USERNAME
291               password: NORDIX_ARM_TOKEN
292       - mask-passwords
293       - fix-workspace-permissions
294
295     scm:
296       - git:
297           url: https://gerrit.nordix.org/infra/test.git
298           branches:
299             - master
300           timeout: 15
301           wipe_workspace: true
302           clean_before: false
303
304     builders:
305       - 'test-package-macro'
306       - 'xtesting-upload-artifact-macro'