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