Merge "Add Euphrates pages for reporting"
[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_SUITE_NAME=healthcheck
149                   node-parameters: true
150                   kill-phase-on: NEVER
151                   abort-all-job: true
152
153 - job-template:
154     name: 'xci-verify-{phase}-{type}-{stream}'
155
156     disabled: false
157
158     concurrent: true
159
160     properties:
161         - logrotate-default
162         - build-blocker:
163             use-build-blocker: true
164             blocking-jobs:
165                 - 'xci-verify-deploy-.*'
166                 - 'xci-verify-healthcheck-.*'
167                 - 'bifrost-verify-.*'
168                 - 'bifrost-periodic-.*'
169                 - 'osa-verify-.*'
170                 - 'osa-periodic-.*'
171             block-level: 'NODE'
172
173     parameters:
174         - string:
175             name: DISTRO
176             default: 'xenial'
177         - string:
178             name: DEPLOY_SCENARIO
179             default: 'os-nosdn-nofeature-noha'
180         - string:
181             name: FUNCTEST_SUITE_NAME
182             default: 'healthcheck'
183         - string:
184             name: XCI_FLAVOR
185             default: 'mini'
186         - string:
187             name: CLEAN_DIB_IMAGES
188             default: 'true'
189         - string:
190             name: OPNFV_RELENG_DEV_PATH
191             default: $WORKSPACE/
192         - string:
193             name: INSTALLER_TYPE
194             default: 'osa'
195         - string:
196             name: GIT_BASE
197             default: https://gerrit.opnfv.org/gerrit/$PROJECT
198             description: 'Git URL to use on this Jenkins Slave'
199
200     wrappers:
201         - ssh-agent-wrapper
202         - build-timeout:
203             timeout: 240
204         - fix-workspace-permissions
205
206     scm:
207         - git-scm-gerrit
208
209     builders:
210         - description-setter:
211             description: "Built on $NODE_NAME"
212         - 'xci-verify-{phase}-macro'
213
214 #--------------------------------
215 # builder macros
216 #--------------------------------
217 - builder:
218     name: 'xci-verify-deploy-macro'
219     builders:
220         - shell: |
221             #!/bin/bash
222
223             # skip the deployment if the patch doesn't impact the deployment
224             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
225                 echo "Skipping the deployment!"
226                 exit 0
227             fi
228
229             # for some reason, the PATH is not set correctly
230             # setting PATH for ansible stuff
231             export PATH=/home/jenkins/.local/bin:$PATH
232
233             cd $WORKSPACE/xci
234             ./xci-deploy.sh
235
236
237 - builder:
238     name: 'xci-verify-healthcheck-macro'
239     builders:
240         - shell: |
241             #!/bin/bash
242
243             # skip the healthcheck if the patch doesn't impact the deployment
244             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
245                 echo "Skipping the healthcheck!"
246                 exit 0
247             fi
248
249             echo "Hello World!"
250
251 # this will be enabled once the xci is prepared
252 #- builder:
253 #    name: 'xci-verify-healthcheck-macro'
254 #    builders:
255 #        - shell:
256 #            !include-raw: ../../utils/fetch_os_creds.sh
257 #        - shell:
258 #            !include-raw: ../functest/functest-alpine.sh