Restrict Gerrit Triggers to OPNFV Gerrit Server
[releng.git] / jjb / daisy4nfv / daisy4nfv-merge-jobs.yml
1 - project:
2     name: 'daisy4nfv-merge-jobs'
3
4     project: 'daisy'
5 #####################################
6 # branch definitions
7 #####################################
8     stream:
9         - master:
10             branch: '{stream}'
11             gs-pathname: ''
12             disabled: false
13 #####################################
14 # patch merge phases
15 #####################################
16     phase:
17         - 'basic':
18             slave-label: 'opnfv-build-centos'
19         - 'build':
20             slave-label: 'opnfv-build-centos'
21         - 'deploy-virtual':
22             slave-label: 'opnfv-build-centos'
23         - 'smoke-test':
24             slave-label: 'opnfv-build-centos'
25         - 'promote':
26             slave-label: 'opnfv-build-centos'
27 #####################################
28 # jobs
29 #####################################
30     jobs:
31         - 'daisy4nfv-merge-{stream}'
32         - 'daisy4nfv-merge-{phase}-{stream}'
33 #####################################
34 # job templates
35 #####################################
36 - job-template:
37     name: 'daisy4nfv-merge-{stream}'
38
39     project-type: multijob
40
41     disabled: false
42
43     concurrent: true
44
45     properties:
46         - throttle:
47             enabled: true
48             max-total: 4
49             option: 'project'
50
51     scm:
52         - gerrit-trigger-scm:
53             credentials-id: '{ssh-credentials}'
54             refspec: '$GERRIT_REFSPEC'
55             choosing-strategy: 'gerrit'
56
57     wrappers:
58         - ssh-agent-credentials:
59             users:
60                 - '{ssh-credentials}'
61         - timeout:
62             timeout: 360
63             fail: true
64
65     triggers:
66         - gerrit:
67             server-name: 'gerrit.opnfv.org'
68             trigger-on:
69                 - change-merged-event
70                 - comment-added-contains-event:
71                     comment-contains-value: 'remerge'
72             projects:
73               - project-compare-type: 'ANT'
74                 project-pattern: '{project}'
75                 branches:
76                   - branch-compare-type: 'ANT'
77                     branch-pattern: '**/{branch}'
78                 forbidden-file-paths:
79                   - compare-type: ANT
80                     pattern: 'docs/**|.gitignore'
81             readable-message: true
82
83     parameters:
84         - project-parameter:
85             project: '{project}'
86         - gerrit-parameter:
87             branch: '{branch}'
88         - 'opnfv-build-defaults'
89         - 'daisy4nfv-merge-defaults':
90             gs-pathname: '{gs-pathname}'
91
92     builders:
93         - description-setter:
94             description: "Built on $NODE_NAME"
95         - multijob:
96             name: basic
97             condition: SUCCESSFUL
98             projects:
99                 - name: 'daisy4nfv-merge-basic-{stream}'
100                   current-parameters: false
101                   predefined-parameters: |
102                     GERRIT_BRANCH=$GERRIT_BRANCH
103                     GERRIT_REFSPEC=$GERRIT_REFSPEC
104                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
105                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
106                   node-parameters: false
107                   kill-phase-on: FAILURE
108                   abort-all-job: true
109         - multijob:
110             name: build
111             condition: SUCCESSFUL
112             projects:
113                 - name: 'daisy4nfv-merge-build-{stream}'
114                   current-parameters: false
115                   predefined-parameters: |
116                     GERRIT_BRANCH=$GERRIT_BRANCH
117                     GERRIT_REFSPEC=$GERRIT_REFSPEC
118                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
119                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
120                   node-parameters: false
121                   kill-phase-on: FAILURE
122                   abort-all-job: true
123         - multijob:
124             name: deploy-virtual
125             condition: SUCCESSFUL
126             projects:
127                 - name: 'daisy4nfv-merge-deploy-virtual-{stream}'
128                   current-parameters: false
129                   predefined-parameters: |
130                     GERRIT_BRANCH=$GERRIT_BRANCH
131                     GERRIT_REFSPEC=$GERRIT_REFSPEC
132                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
133                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
134                   node-parameters: false
135                   kill-phase-on: FAILURE
136                   abort-all-job: true
137         - multijob:
138             name: smoke-test
139             condition: SUCCESSFUL
140             projects:
141                 - name: 'daisy4nfv-merge-smoke-test-{stream}'
142                   current-parameters: false
143                   predefined-parameters: |
144                     GERRIT_BRANCH=$GERRIT_BRANCH
145                     GERRIT_REFSPEC=$GERRIT_REFSPEC
146                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
147                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
148                   node-parameters: false
149                   kill-phase-on: FAILURE
150                   abort-all-job: true
151         - multijob:
152             name: promote
153             condition: SUCCESSFUL
154             projects:
155                 - name: 'daisy4nfv-merge-promote-{stream}'
156                   current-parameters: false
157                   predefined-parameters: |
158                     GERRIT_BRANCH=$GERRIT_BRANCH
159                     GERRIT_REFSPEC=$GERRIT_REFSPEC
160                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
161                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
162                   node-parameters: false
163                   kill-phase-on: FAILURE
164                   abort-all-job: true
165
166 - job-template:
167     name: 'daisy4nfv-merge-{phase}-{stream}'
168
169     disabled: '{obj:disabled}'
170
171     concurrent: true
172
173     properties:
174         - throttle:
175             enabled: true
176             max-total: 6
177             option: 'project'
178         - build-blocker:
179             use-build-blocker: true
180             blocking-jobs:
181                 - 'daisy4nfv-merge-deploy-.*'
182                 - 'daisy4nfv-merge-test-.*'
183             block-level: 'NODE'
184
185     scm:
186         - gerrit-trigger-scm:
187             credentials-id: '{ssh-credentials}'
188             refspec: '$GERRIT_REFSPEC'
189             choosing-strategy: 'gerrit'
190
191     wrappers:
192         - ssh-agent-credentials:
193             users:
194                 - '{ssh-credentials}'
195         - timeout:
196             timeout: 360
197             fail: true
198
199     parameters:
200         - project-parameter:
201             project: '{project}'
202         - gerrit-parameter:
203             branch: '{branch}'
204         - '{slave-label}-defaults'
205         - 'daisy4nfv-merge-defaults':
206             gs-pathname: '{gs-pathname}'
207
208     builders:
209         - description-setter:
210             description: "Built on $NODE_NAME"
211         - '{project}-merge-{phase}-macro'
212 #####################################
213 # builder macros
214 #####################################
215 - builder:
216     name: 'daisy-merge-basic-macro'
217     builders:
218         - shell:
219             !include-raw: ./daisy4nfv-basic.sh
220
221 - builder:
222     name: 'daisy-merge-build-macro'
223     builders:
224         - shell:
225             !include-raw:
226                 - ./daisy4nfv-build.sh
227                 - ./daisy4nfv-upload-artifact.sh
228                 - ./daisy4nfv-workspace-cleanup.sh
229
230 - builder:
231     name: 'daisy-merge-deploy-virtual-macro'
232     builders:
233         - shell:
234             !include-raw:
235                 - ./daisy4nfv-download-artifact.sh
236                 - ./daisy4nfv-virtual-deploy.sh
237                 - ./daisy4nfv-workspace-cleanup.sh
238
239 - builder:
240     name: 'daisy-merge-smoke-test-macro'
241     builders:
242         - shell: |
243             #!/bin/bash
244
245             echo "Not activated!"
246
247 - builder:
248     name: 'daisy-merge-promote-macro'
249     builders:
250         - shell: |
251             #!/bin/bash
252
253             echo "Not activated!"
254 #####################################
255 # parameter macros
256 #####################################
257 - parameter:
258     name: 'daisy4nfv-merge-defaults'
259     parameters:
260         - string:
261             name: BUILD_DIRECTORY
262             default: $WORKSPACE/build_output
263             description: "Directory where the build artifact will be located upon the completion of the build."
264         - string:
265             name: CACHE_DIRECTORY
266             default: $HOME/opnfv/cache/$INSTALLER_TYPE
267             description: "Directory where the cache to be used during the build is located."
268         - string:
269             name: GS_URL
270             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
271             description: "URL to Google Storage."