[Functest] Support functest-suite with Alpine containers
[releng.git] / jjb / xci / xci-verify-jobs.yml
1 - project:
2     name: 'opnfv-xci-verify'
3
4     project: releng-xci
5 #--------------------------------
6 # branches
7 #--------------------------------
8     stream:
9         - master:
10             branch: '{stream}'
11 #--------------------------------
12 # distros
13 #--------------------------------
14     distro:
15         - 'xenial':
16             disabled: false
17         - 'centos7':
18             disabled: true
19         - 'suse':
20             disabled: true
21 #--------------------------------
22 # type
23 #--------------------------------
24     type:
25         - virtual
26 #--------------------------------
27 # patch verification phases
28 #--------------------------------
29     phase:
30         - 'deploy'
31         - 'healthcheck'
32 #--------------------------------
33 # jobs
34 #--------------------------------
35     jobs:
36         - 'xci-verify-{distro}-{type}-{stream}'
37         - 'xci-verify-{phase}-{type}-{stream}'
38 #--------------------------------
39 # job templates
40 #--------------------------------
41 - job-template:
42     name: 'xci-verify-{distro}-{type}-{stream}'
43
44     project-type: multijob
45
46     disabled: '{obj:disabled}'
47
48     concurrent: true
49
50     properties:
51         - logrotate-default
52         - build-blocker:
53             use-build-blocker: true
54             blocking-jobs:
55                 - 'xci-verify-.*'
56                 - 'bifrost-verify-.*'
57                 - 'bifrost-periodic-.*'
58                 - 'osa-verify-.*'
59                 - 'osa-periodic-.*'
60             block-level: 'NODE'
61
62     wrappers:
63         - ssh-agent-wrapper
64         - build-timeout:
65             timeout: 240
66         - fix-workspace-permissions
67
68     scm:
69         - git-scm-gerrit
70
71     triggers:
72         - gerrit:
73             server-name: 'gerrit.opnfv.org'
74             trigger-on:
75                 - patchset-created-event:
76                     exclude-drafts: 'false'
77                     exclude-trivial-rebase: 'false'
78                     exclude-no-code-change: 'true'
79                 - draft-published-event
80                 - comment-added-contains-event:
81                     comment-contains-value: 'recheck'
82                 - comment-added-contains-event:
83                     comment-contains-value: 'reverify'
84             projects:
85               - project-compare-type: 'ANT'
86                 project-pattern: '{project}'
87                 branches:
88                   - branch-compare-type: 'ANT'
89                     branch-pattern: '**/{branch}'
90                 disable-strict-forbidden-file-verification: 'true'
91                 file-paths:
92                   - compare-type: ANT
93                     pattern: 'bifrost/**'
94                   - compare-type: ANT
95                     pattern: 'xci/**'
96                 forbidden-file-paths:
97                   - compare-type: ANT
98                     pattern: 'prototypes/**'
99                   - compare-type: ANT
100                     pattern: 'upstream/**'
101                   - compare-type: ANT
102                     pattern: '**/README.rst'
103                   - compare-type: ANT
104                     pattern: 'docs/**'
105             readable-message: true
106
107     parameters:
108         - project-parameter:
109             project: '{project}'
110             branch: '{branch}'
111         - label:
112             name: SLAVE_LABEL
113             default: 'xci-virtual-{distro}'
114         - string:
115             name: CLEAN_DIB_IMAGES
116             default: 'true'
117         - string:
118             name: GIT_BASE
119             default: https://gerrit.opnfv.org/gerrit/$PROJECT
120             description: 'Git URL to use on this Jenkins Slave'
121
122     builders:
123         - description-setter:
124             description: "Built on $NODE_NAME"
125         - multijob:
126             name: deploy
127             condition: SUCCESSFUL
128             projects:
129                 - name: 'xci-verify-deploy-{type}-{stream}'
130                   current-parameters: true
131                   predefined-parameters: |
132                     DISTRO={distro}
133                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
134                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
135                   node-parameters: true
136                   kill-phase-on: FAILURE
137                   abort-all-job: true
138         - multijob:
139             name: healthcheck
140             condition: SUCCESSFUL
141             projects:
142                 - name: 'xci-verify-healthcheck-{type}-{stream}'
143                   current-parameters: true
144                   predefined-parameters: |
145                     DISTRO={distro}
146                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
147                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
148                     FUNCTEST_MODE=tier
149                     FUNCTEST_TIER=healthcheck
150                   node-parameters: true
151                   kill-phase-on: NEVER
152                   abort-all-job: true
153
154 - job-template:
155     name: 'xci-verify-{phase}-{type}-{stream}'
156
157     disabled: false
158
159     concurrent: true
160
161     properties:
162         - logrotate-default
163         - build-blocker:
164             use-build-blocker: true
165             blocking-jobs:
166                 - 'xci-verify-deploy-.*'
167                 - 'xci-verify-healthcheck-.*'
168                 - 'bifrost-verify-.*'
169                 - 'bifrost-periodic-.*'
170                 - 'osa-verify-.*'
171                 - 'osa-periodic-.*'
172             block-level: 'NODE'
173
174     parameters:
175         - string:
176             name: DISTRO
177             default: 'xenial'
178         - string:
179             name: DEPLOY_SCENARIO
180             default: 'os-nosdn-nofeature-noha'
181         - string:
182             name: FUNCTEST_MODE
183             default: 'tier'
184         - string:
185             name: FUNCTEST_SUITE_NAME
186             default: 'healthcheck'
187         - string:
188             name: XCI_FLAVOR
189             default: 'mini'
190         - string:
191             name: CLEAN_DIB_IMAGES
192             default: 'true'
193         - string:
194             name: OPNFV_RELENG_DEV_PATH
195             default: $WORKSPACE/
196         - string:
197             name: INSTALLER_TYPE
198             default: 'osa'
199         - string:
200             name: GIT_BASE
201             default: https://gerrit.opnfv.org/gerrit/$PROJECT
202             description: 'Git URL to use on this Jenkins Slave'
203
204     wrappers:
205         - ssh-agent-wrapper
206         - build-timeout:
207             timeout: 240
208         - fix-workspace-permissions
209
210     scm:
211         - git-scm-gerrit
212
213     builders:
214         - description-setter:
215             description: "Built on $NODE_NAME"
216         - 'xci-verify-{phase}-macro'
217
218 #--------------------------------
219 # builder macros
220 #--------------------------------
221 - builder:
222     name: 'xci-verify-deploy-macro'
223     builders:
224         - shell: |
225             #!/bin/bash
226
227             # skip the deployment if the patch doesn't impact the deployment
228             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
229                 echo "Skipping the deployment!"
230                 exit 0
231             fi
232
233             # for some reason, the PATH is not set correctly
234             # setting PATH for ansible stuff
235             export PATH=/home/jenkins/.local/bin:$PATH
236
237             cd $WORKSPACE/xci
238             ./xci-deploy.sh
239
240
241 - builder:
242     name: 'xci-verify-healthcheck-macro'
243     builders:
244         - shell: |
245             #!/bin/bash
246
247             # skip the healthcheck if the patch doesn't impact the deployment
248             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
249                 echo "Skipping the healthcheck!"
250                 exit 0
251             fi
252
253             echo "Hello World!"
254
255 # this will be enabled once the xci is prepared
256 #- builder:
257 #    name: 'xci-verify-healthcheck-macro'
258 #    builders:
259 #        - shell:
260 #            !include-raw: ../../utils/fetch_os_creds.sh
261 #        - shell:
262 #            !include-raw: ../functest/functest-alpine.sh