xci: Always clone releng-xci into WORKSPACE for merge jobs
[releng.git] / jjb / xci / xci-merge-jobs.yml
1 ---
2 - project:
3     name: 'opnfv-xci-merge'
4
5     # -------------------------------
6     # branches
7     # -------------------------------
8     stream:
9       - master:
10           branch: '{stream}'
11     # -------------------------------
12     # distros
13     # -------------------------------
14     distro:
15       - ubuntu:
16           disabled: false
17       - centos:
18           disabled: false
19       - opensuse:
20           disabled: false
21     # -------------------------------
22     # type
23     # -------------------------------
24     type:
25       - virtual
26     # -------------------------------
27     # patch verification phases
28     # -------------------------------
29     phase:
30       - 'deploy'
31       - 'healthcheck'
32       - 'promote'
33     # -------------------------------
34     # scenarios
35     # -------------------------------
36     scenario:
37       - 'os-odl-sfc':
38           project: sfc
39     # -------------------------------
40     # jobs
41     # -------------------------------
42     jobs:
43       - 'xci-{scenario}-{type}-{distro}-merge-{stream}'
44       - 'xci-{phase}-{type}-{distro}-merge-{stream}'
45 # -------------------------------
46 # job templates
47 # -------------------------------
48 - job-template:
49     name: 'xci-{scenario}-{type}-{distro}-merge-{stream}'
50
51     project-type: multijob
52
53     disabled: '{obj:disabled}'
54
55     concurrent: false
56
57     properties:
58       - logrotate-default
59       - build-blocker:
60           use-build-blocker: true
61           blocking-jobs:
62             - 'xci-verify-{distro}-.*'
63             - 'bifrost-verify-{distro}-.*'
64             - 'bifrost-periodic-{distro}-.*'
65             - 'xci-osa-verify-{distro}-.*'
66             - 'xci-osa-periodic-{distro}-.*'
67             - 'xci-(os|k8s).*?-virtual-{distro}-.*'
68           block-level: 'NODE'
69
70     wrappers:
71       - ssh-agent-wrapper
72       - build-timeout:
73           timeout: 240
74       - fix-workspace-permissions
75
76     scm:
77       - git:
78           credentials-id: '$SSH_CREDENTIAL_ID'
79           url: 'https://gerrit.opnfv.org/gerrit/releng-xci'
80           branches:
81             - 'origin/master'
82           timeout: 15
83
84     triggers:
85       - gerrit:
86           server-name: 'gerrit.opnfv.org'
87           trigger-on:
88             - change-merged-event
89             - comment-added-contains-event:
90                 comment-contains-value: 'remerge'
91           projects:
92             - project-compare-type: 'ANT'
93               project-pattern: '{obj:project}'
94               branches:
95                 - branch-compare-type: 'ANT'
96                   branch-pattern: '**/{branch}'
97               disable-strict-forbidden-file-verification: 'true'
98               file-paths:
99                 - compare-type: ANT
100                   pattern: 'scenarios/**'
101           readable-message: true
102           custom-url: '* $JOB_NAME $BUILD_URL'
103
104     parameters:
105       - project-parameter:
106           project: '{obj:project}'
107           branch: '{branch}'
108       - label:
109           name: SLAVE_LABEL
110           default: 'xci-virtual'
111       - string:
112           name: CLEAN_DIB_IMAGES
113           default: 'true'
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-deploy-{type}-{distro}-merge-{stream}'
127               current-parameters: true
128               predefined-parameters: |
129                 PROJECT=$PROJECT
130                 DISTRO={distro}
131                 DEPLOY_SCENARIO={scenario}
132                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
133                 GERRIT_BRANCH=$GERRIT_BRANCH
134                 GERRIT_REFSPEC=$GERRIT_REFSPEC
135                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
136                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
137               node-parameters: true
138               kill-phase-on: FAILURE
139               abort-all-job: true
140       - multijob:
141           name: healthcheck
142           condition: SUCCESSFUL
143           projects:
144             - name: 'xci-healthcheck-{type}-{distro}-merge-{stream}'
145               current-parameters: true
146               predefined-parameters: |
147                 PROJECT=$PROJECT
148                 DISTRO={distro}
149                 DEPLOY_SCENARIO={scenario}
150                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
151                 FUNCTEST_MODE=tier
152                 FUNCTEST_TIER=healthcheck
153                 GERRIT_BRANCH=$GERRIT_BRANCH
154                 GERRIT_REFSPEC=$GERRIT_REFSPEC
155                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
156                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
157               node-parameters: true
158               kill-phase-on: NEVER
159               abort-all-job: true
160
161 - job-template:
162     name: 'xci-{phase}-{type}-{distro}-merge-{stream}'
163
164     disabled: false
165
166     concurrent: true
167
168     properties:
169       - logrotate-default
170       - build-blocker:
171           use-build-blocker: true
172           blocking-jobs:
173             - '.*-bifrost-verify-.*'
174             - '.*-bifrost-periodic-.*'
175             - 'osa-verify-.*'
176             - 'osa-periodic-.*'
177           block-level: 'NODE'
178
179     parameters:
180       - string:
181           name: PROJECT
182           default: 'releng-xci'
183       - string:
184           name: DISTRO
185           default: 'ubuntu'
186       - string:
187           name: DEPLOY_SCENARIO
188           default: 'os-nosdn-nofeature-noha'
189       - string:
190           name: FUNCTEST_MODE
191           default: 'tier'
192       - string:
193           name: FUNCTEST_SUITE_NAME
194           default: 'healthcheck'
195       - string:
196           name: XCI_FLAVOR
197           default: 'mini'
198       - string:
199           name: CLEAN_DIB_IMAGES
200           default: 'true'
201       - string:
202           name: OPNFV_RELENG_DEV_PATH
203           default: $WORKSPACE/
204       - string:
205           name: INSTALLER_TYPE
206           default: 'osa'
207       - string:
208           name: GIT_BASE
209           default: https://gerrit.opnfv.org/gerrit/$PROJECT
210           description: 'Git URL to use on this Jenkins Slave'
211
212     wrappers:
213       - ssh-agent-wrapper
214       - build-timeout:
215           timeout: 240
216       - fix-workspace-permissions
217
218     scm:
219       - git-scm
220
221     builders:
222       - description-setter:
223           description: "Built on $NODE_NAME"
224       - 'xci-merge-{phase}-macro'
225
226 # -------------------------------
227 # builder macros
228 # -------------------------------
229 - builder:
230     name: 'xci-merge-deploy-macro'
231     builders:
232       - shell:
233           !include-raw: ./xci-start-new-vm.sh
234       - shell:
235           !include-raw: ./xci-start-deployment.sh
236
237 - builder:
238     name: 'xci-merge-healthcheck-macro'
239     builders:
240       - shell:
241           !include-raw: ./xci-run-functest.sh
242       - shell:
243           !include-raw: ./xci-cleanup.sh
244
245 - builder:
246     name: 'xci-merge-promote-macro'
247     builders:
248       - shell:
249           !include-raw: ./xci-promote.sh