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