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