Merge "leverage LFID authentication to pod creation"
[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: 'xci/**'
94                 forbidden-file-paths:
95                   - compare-type: ANT
96                     pattern: 'bifrost/**'
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: GIT_BASE
116             default: https://gerrit.opnfv.org/gerrit/$PROJECT
117             description: 'Git URL to use on this Jenkins Slave'
118
119     builders:
120         - description-setter:
121             description: "Built on $NODE_NAME"
122         - multijob:
123             name: deploy
124             condition: SUCCESSFUL
125             projects:
126                 - name: 'xci-verify-deploy-{type}-{stream}'
127                   current-parameters: true
128                   predefined-parameters: |
129                     DISTRO={distro}
130                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
131                   node-parameters: true
132                   kill-phase-on: FAILURE
133                   abort-all-job: true
134         - multijob:
135             name: healthcheck
136             condition: SUCCESSFUL
137             projects:
138                 - name: 'xci-verify-healthcheck-{type}-{stream}'
139                   current-parameters: true
140                   predefined-parameters: |
141                     DISTRO={distro}
142                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
143                     FUNCTEST_SUITE_NAME=healthcheck
144                   node-parameters: true
145                   kill-phase-on: NEVER
146                   abort-all-job: true
147
148 - job-template:
149     name: 'xci-verify-{phase}-{type}-{stream}'
150
151     disabled: false
152
153     concurrent: true
154
155     properties:
156         - logrotate-default
157         - build-blocker:
158             use-build-blocker: true
159             blocking-jobs:
160                 - 'xci-verify-deploy-.*'
161                 - 'xci-verify-healthcheck-.*'
162                 - 'bifrost-verify-.*'
163                 - 'bifrost-periodic-.*'
164                 - 'osa-verify-.*'
165                 - 'osa-periodic-.*'
166             block-level: 'NODE'
167
168     parameters:
169         - string:
170             name: DISTRO
171             default: 'xenial'
172         - string:
173             name: DEPLOY_SCENARIO
174             default: 'os-nosdn-nofeature-noha'
175         - string:
176             name: FUNCTEST_SUITE_NAME
177             default: 'healthcheck'
178         - string:
179             name: XCI_FLAVOR
180             default: 'mini'
181         - string:
182             name: OPNFV_RELENG_DEV_PATH
183             default: $WORKSPACE/
184         - string:
185             name: INSTALLER_TYPE
186             default: 'osa'
187         - string:
188             name: GIT_BASE
189             default: https://gerrit.opnfv.org/gerrit/$PROJECT
190             description: 'Git URL to use on this Jenkins Slave'
191
192     wrappers:
193         - ssh-agent-wrapper
194         - build-timeout:
195             timeout: 240
196         - fix-workspace-permissions
197
198     scm:
199         - git-scm-gerrit
200
201     builders:
202         - description-setter:
203             description: "Built on $NODE_NAME"
204         - 'xci-verify-{phase}-macro'
205
206 #--------------------------------
207 # builder macros
208 #--------------------------------
209 - builder:
210     name: 'xci-verify-deploy-macro'
211     builders:
212         - shell: |
213             #!/bin/bash
214
215             # skip the deployment if the patch doesn't impact the deployment
216             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
217                 echo "Skipping the deployment!"
218                 exit 0
219             fi
220
221             # for some reason, the PATH is not set correctly
222             # setting PATH for ansible stuff
223             export PATH=/home/jenkins/.local/bin:$PATH
224
225             cd $WORKSPACE/xci
226             ./xci-deploy.sh
227
228
229 - builder:
230     name: 'xci-verify-healthcheck-macro'
231     builders:
232         - shell: |
233             #!/bin/bash
234
235             # skip the healthcheck if the patch doesn't impact the deployment
236             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
237                 echo "Skipping the healthcheck!"
238                 exit 0
239             fi
240
241             echo "Hello World!"
242
243 # this will be enabled once the xci is prepared
244 #- builder:
245 #    name: 'xci-verify-healthcheck-macro'
246 #    builders:
247 #        - shell:
248 #            !include-raw: ../../utils/fetch_os_creds.sh
249 #        - shell:
250 #            !include-raw: ../functest/functest-alpine.sh