dd993c4d622be0f198a7f7ab8776c6730b5ba349
[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-cicd'
29           execution-mode: 'packaging'
30           gated-projects: 'infra/engine|infra/provisioner/bifrost|infra/provisioner/heat|infra/installer/kolla|infra/installer/kubespray'
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: ENGINE_REPO_URL
67           default: 'https://gerrit.nordix.org/infra/engine.git'
68           description: 'URL to Nordix Cloud Infra engine repository'
69       - string:
70           name: ARTIFACTS_TO_UPLOAD
71           default: "k8s-installer-ubuntu1804.bsx"
72           description: 'Artifacts to upload'
73       - string:
74           name: NORDIX_ARM_PUBLIC_IP
75           default: '91.106.198.25'
76           description: 'Public IP of Nordix Artifactory. Offline deployments can not resolve domain name'
77       - string:
78           name: NORDIX_ARM_HTTPS_URL
79           default: 'https://artifactory.nordix.org/artifactory'
80           description: 'URL to Nordix Artifactory'
81       - string:
82           name: NORDIX_ARM_REPO
83           default: 'nordix-kubernetes'
84           description: 'Name of the repository to upload and download artifact to/from. Depends on the stack'
85       - string:
86           name: NORDIX_ARTIFACT_URL
87           default: "$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/installer/oss/gerrit/$GERRIT_CHANGE_NUMBER"
88           description: 'Artifact to download'
89       - string:
90           name: CI_LOOP
91           default: 'verify'
92           description: 'CI loop type'
93       - label:
94           name: SLAVE_LABEL
95           default: 'engine-package-{distro}'
96           description: 'Slave label to schedule this job on.'
97       - project-parameters:
98           project: $GERRIT_PROJECT
99           branch: '{branch}'
100           description: 'The project and branch which the change is proposed for'
101       - nordix-gerrit-parameters
102
103     properties:
104       - logrotate
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       - throttle:
114           max-per-node: 1
115           max-total: 3
116           option: project
117
118     scm:
119       - git-scm-gerrit:
120           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
121           branch: refs/heads/$GERRIT_BRANCH
122           refspec: $GERRIT_REFSPEC
123           wipe_workspace: true
124           clean_before: false
125
126     triggers:
127       - gerrit:
128           server-name: 'Nordix Gerrit'
129           trigger-on:
130             - patchset-created-event:
131                 exclude-drafts: 'false'
132                 exclude-trivial-rebase: 'false'
133                 exclude-no-code-change: 'false'
134             - draft-published-event
135             - comment-added-contains-event:
136                 comment-contains-value: 'recheck'
137             - comment-added-contains-event:
138                 comment-contains-value: 'reverify'
139           projects:
140             - project-compare-type: 'REG_EXP'
141               project-pattern: '{gated-projects}'
142               branches:
143                 - branch-compare-type: 'ANT'
144                   branch-pattern: '**/{branch}'
145               disable-strict-forbidden-file-verification: 'true'
146               forbidden-file-paths:
147                 - compare-type: ANT
148                   pattern: 'docs/**|releasenotes/**'
149           skip-vote:
150             successful: '{obj:successful}'
151             failed: '{obj:failed}'
152             unstable: '{obj:unstable}'
153             notbuilt: '{obj:notbuilt}'
154           custom-url: '* $JOB_NAME $BUILD_URL'
155           readable-message: 'true'
156           dependency-jobs: '{dependency-jobs}'
157
158     wrappers:
159       - openstack:
160           single-use: True
161       - build-timeout:
162           timeout: 70
163       - credentials-binding:
164           - username-password-separated:
165               credential-id: 'nordix-cicd-arm-credentials'
166               username: NORDIX_ARM_USERNAME
167               password: NORDIX_ARM_TOKEN
168       - mask-passwords
169       - pre-scm-buildstep:
170           failOnError: true
171           buildsteps:
172             - system-groovy:
173                 command: |
174                   def build = this.getProperty('binding').getVariable('build')
175                   def listener = this.getProperty('binding').getVariable('listener')
176                   if (build.getEnvironment(listener).{dependency-job-var} != "SUCCESS") {{
177                     println "WARN  : Aborting build since dependent job did not succeed!"
178                     throw new InterruptedException()
179                   }}
180             - shell: |
181                 #!/bin/bash
182                 sudo chown -R $USER:$USER $WORKSPACE || exit 1
183
184
185     builders:
186       - 'generate-sdf-for-change-macro'
187       - 'generate-ssh-keypair-macro'
188       - 'wait-pkg-mgr-macro'
189       - 'package-macro'
190       - 'upload-artifact-macro'