64a2d0de56095f7960905a056a4d031d702a1c5f
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-engine.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying cloud-infra
23 # engine from the tip of the master branch periodically to check the stability of it.
24 #
25 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
26 # The slaves have
27 #   - Ubuntu1604 as the base distro
28 #   - nested virtualization
29 #   - internet access
30 #   - passwordless sudo
31 #   - 16 CPUs/32GB RAM/200 GB Disk
32 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
33 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
34 #
35 # The slaves should not have a cloud infra scenario deployed on them.
36 #--------------------------------------------------------------------------------------
37
38 - project:
39     name: 'cloud-infra-periodic-engine'
40
41     project: 'infra/engine'
42
43     stream:
44       - 'master':
45           branch: '{stream}'
46           disabled: 'false'
47
48     os:
49       - ubuntu1804:
50           disabled: 'false'
51           distribution: 'ubuntu18'
52           ipa_dib_os_element: 'coreos'
53           dib_os_release: 'bionic'
54           dib_os_element: 'ubuntu-minimal'
55       - centos7:
56           disabled: 'true'
57           distribution: 'centos7'
58           ipa_dib_os_element: 'coreos'
59           dib_os_release: '7'
60           dib_os_element: 'centos-minimal'
61
62     type:
63       - virtual
64
65     phase:
66       - deploy
67       - test
68
69     jobs:
70       - 'cloud-infra-periodic-engine-{os}-{type}-{stream}'
71       - 'cloud-infra-periodic-{os}-{phase}-{type}-{stream}'
72
73 - job-template:
74     name: 'cloud-infra-periodic-engine-{os}-{type}-{stream}'
75
76     project-type: multijob
77
78     disabled: '{obj:disabled}'
79
80     concurrent: true
81
82     parameters:
83       - project-parameters:
84           project: '{project}'
85           branch: '{branch}'
86       - nordix-gerrit-parameters
87       - label:
88           name: SLAVE_LABEL
89           default: 'vpod-deploy-{os}'
90           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
91       - string:
92           name: DISTRIBUTION
93           default: '{distribution}'
94           description: 'Distribution to use for configuring target nodes (networking etc.)'
95       - string:
96           name: USE_PREBUILT_DEPLOYMENT_IMAGE
97           default: 'true'
98           description: 'Use prebuilt deployment image while running as part of CI/CD'
99       - string:
100           name: IPA_DIB_OS_ELEMENT
101           default: '{ipa_dib_os_element}'
102           description: 'DIB OS Element to use for building the ramdisk image'
103       - string:
104           name: DIB_OS_RELEASE
105           default: '{dib_os_release}'
106           description: 'DIB OS Release to use for building the deployment image to provision target nodes with'
107       - string:
108           name: DIB_OS_ELEMENT
109           default: '{dib_os_element}'
110           description: 'DIB OS Element to use for building the deployment image to provision target nodes with'
111       - string:
112           name: CLEANUP
113           default: 'true'
114           description: 'Cleanup leftovers of the previous run'
115
116     properties:
117       - logrotate
118       - build-blocker:
119           use-build-blocker: true
120           blocking-jobs:
121             - 'cloud-infra-verify-engine-{os}-.*'
122             - 'cloud-infra-periodic-engine-{os}-.*'
123             - 'cloud-infra-os-.*'
124             - 'cloud-infra-k8-.*'
125           block-level: 'NODE'
126       - throttle:
127           max-per-node: 1
128           max-total: 3
129           option: project
130
131     wrappers:
132       - build-timeout:
133           timeout: 120
134       - fix-workspace-permissions
135       - openstack:
136           single-use: True
137
138     scm:
139       - git-scm:
140           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
141           branch: '{branch}'
142           refspec: ''
143
144     triggers:
145       - timed: 'H H/2 * * *'
146
147     builders:
148       - multijob:
149           name: deploy
150           condition: SUCCESSFUL
151           projects:
152             - name: 'cloud-infra-periodic-{os}-deploy-{type}-{stream}'
153               current-parameters: true
154               predefined-parameters: |
155                 DISTRIBUTION=$DISTRIBUTION
156                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
157                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
158                 DIB_OS_RELEASE=$DIB_OS_RELEASE
159                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
160                 CLEANUP=$CLEANUP
161               git-revision: true
162               node-parameters: true
163               kill-phase-on: FAILURE
164               abort-all-job: true
165       - multijob:
166           name: test
167           condition: SUCCESSFUL
168           projects:
169             - name: 'cloud-infra-periodic-{os}-test-{type}-{stream}'
170               current-parameters: true
171               predefined-parameters: |
172                 DISTRIBUTION=$DISTRIBUTION
173                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
174                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
175                 DIB_OS_RELEASE=$DIB_OS_RELEASE
176                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
177                 CLEANUP=$CLEANUP
178               node-parameters: true
179               kill-phase-on: test
180               abort-all-job: true
181
182 - job-template:
183     name: 'cloud-infra-periodic-{os}-{phase}-{type}-{stream}'
184
185     disabled: false
186
187     concurrent: true
188
189     properties:
190       - logrotate
191
192     parameters:
193       - string:
194           name: PROJECT
195           default: $GERRIT_PROJECT
196       - string:
197           name: DISTRIBUTION
198           default: 'ubuntu18'
199           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
200       - string:
201           name: USE_PREBUILT_DEPLOYMENT_IMAGE
202           default: 'false'
203           description: 'Use prebuilt deployment image while running as part of CI/CD'
204       - string:
205           name: IPA_DIB_OS_ELEMENT
206           default: 'fedora'
207           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
208       - string:
209           name: DIB_OS_RELEASE
210           default: 'bionic'
211           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
212       - string:
213           name: DIB_OS_ELEMENT
214           default: 'ubuntu-minimal'
215           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
216       - string:
217           name: TEST_REPO_URL
218           default: 'https://gerrit.nordix.org/infra/test.git'
219           description: 'URL to Nordix Cloud Infra test repository'
220       - string:
221           name: CLEANUP
222           default: 'false'
223
224     wrappers:
225       - build-timeout:
226           timeout: 120
227       - fix-workspace-permissions
228
229     scm:
230       - git-scm:
231           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
232           branch: '{branch}'
233           refspec: ''
234
235     builders:
236       - 'cloud-infra-periodic-{phase}-macro'
237
238 # -------------------------------
239 # builder macros
240 # -------------------------------
241
242 - builder:
243     name: 'cloud-infra-periodic-deploy-macro'
244     builders:
245       - shell:
246           !include-raw: ./wait-for-pkg-manager.sh
247       - shell:
248           !include-raw: ./cloud-infra-deploy.sh
249
250 - builder:
251     name: 'cloud-infra-periodic-test-macro'
252     builders:
253       - shell:
254           !include-raw: ./prepare-for-test.sh
255       - shell:
256           !include-raw: ./cloud-infra-test.sh
257
258 # vim: set ts=2 sw=2 expandtab: