Merge "installers: Use global macro 'clean-workspace'"
[releng.git] / jjb / daisy4nfv / daisy4nfv-verify-jobs.yml
1 - project:
2     name: 'daisy4nfv-verify-jobs'
3     project: 'daisy'
4     installer: 'daisy'
5 ##########################################################
6 # use alias to keep the jobs'name existed alread unchanged
7 ##########################################################
8     alias: 'daisy4nfv'
9
10 #####################################
11 # branch definitions
12 #####################################
13     stream:
14         - master:
15             branch: '{stream}'
16             gs-pathname: ''
17             disabled: false
18         - danube:
19             branch: 'stable/{stream}'
20             gs-pathname: '/{stream}'
21             disabled: false
22 #####################################
23 # patch verification phases
24 #####################################
25     phase:
26         - unit:
27             slave-label: 'opnfv-build'
28         - build:
29             slave-label: 'opnfv-build-centos'
30 #####################################
31 # jobs
32 #####################################
33     jobs:
34         - '{alias}-verify-{stream}'
35         - '{alias}-verify-{phase}-{stream}'
36 #####################################
37 # job templates
38 #####################################
39 - job-template:
40     name: '{alias}-verify-{stream}'
41     project-type: multijob
42     disabled: false
43     concurrent: true
44     properties:
45         - logrotate-default
46         - throttle:
47             enabled: true
48             max-total: 4
49             option: 'project'
50         - build-blocker:
51             use-build-blocker: true
52             blocking-jobs:
53                 - '{alias}-merge-build-.*'
54             block-level: 'NODE'
55
56     scm:
57         - git-scm-gerrit
58     wrappers:
59         - ssh-agent-wrapper
60         - timeout:
61             timeout: 360
62             fail: true
63     triggers:
64         - gerrit:
65             server-name: 'gerrit.opnfv.org'
66             trigger-on:
67                 - patchset-created-event:
68                     exclude-drafts: 'false'
69                     exclude-trivial-rebase: 'false'
70                     exclude-no-code-change: 'false'
71                 - draft-published-event
72                 - comment-added-contains-event:
73                     comment-contains-value: 'recheck'
74                 - comment-added-contains-event:
75                     comment-contains-value: 'reverify'
76             projects:
77                 - project-compare-type: 'ANT'
78                   project-pattern: '{project}'
79                   branches:
80                       - branch-compare-type: 'ANT'
81                         branch-pattern: '**/{branch}'
82                   file-paths:
83                       - compare-type: ANT
84                         pattern: 'ci/**'
85                       - compare-type: ANT
86                         pattern: 'code/**'
87                       - compare-type: ANT
88                         pattern: 'deploy/**'
89                   disable-strict-forbidden-file-verification: 'true'
90                   forbidden-file-paths:
91                       - compare-type: ANT
92                         pattern: 'docs/**'
93                       - compare-type: ANT
94                         pattern: '.gitignore'
95             readable-message: true
96
97     parameters:
98         - project-parameter:
99             project: '{project}'
100             branch: '{branch}'
101         - 'opnfv-build-centos-defaults'
102         - '{alias}-verify-defaults':
103             gs-pathname: '{gs-pathname}'
104
105     builders:
106         - description-setter:
107             description: "Built on $NODE_NAME"
108         - multijob:
109             name: unit
110             condition: SUCCESSFUL
111             projects:
112                 - name: '{alias}-verify-unit-{stream}'
113                   current-parameters: false
114                   predefined-parameters: |
115                     BRANCH=$BRANCH
116                     GERRIT_REFSPEC=$GERRIT_REFSPEC
117                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
118                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
119                   node-parameters: false
120                   kill-phase-on: FAILURE
121                   abort-all-job: true
122         - multijob:
123             name: build
124             condition: SUCCESSFUL
125             projects:
126                 - name: '{alias}-verify-build-{stream}'
127                   current-parameters: false
128                   predefined-parameters: |
129                     BRANCH=$BRANCH
130                     GERRIT_REFSPEC=$GERRIT_REFSPEC
131                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
132                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
133                   node-parameters: false
134                   kill-phase-on: FAILURE
135                   abort-all-job: true
136
137 - job-template:
138     name: '{alias}-verify-{phase}-{stream}'
139     disabled: '{obj:disabled}'
140     concurrent: true
141     properties:
142         - logrotate-default
143         - throttle:
144             enabled: true
145             max-total: 6
146             option: 'project'
147         - build-blocker:
148             use-build-blocker: true
149             blocking-jobs:
150                 - '{alias}-merge-build-.*'
151                 - '{alias}-verify-build-.*'
152                 - '{installer}-daily-.*'
153             block-level: 'NODE'
154
155     scm:
156         - git-scm-gerrit
157     wrappers:
158         - ssh-agent-wrapper
159         - timeout:
160             timeout: 360
161             fail: true
162     parameters:
163         - project-parameter:
164             project: '{project}'
165             branch: '{branch}'
166         - '{installer}-defaults'
167         - '{slave-label}-defaults'
168         - '{alias}-verify-defaults':
169             gs-pathname: '{gs-pathname}'
170
171     builders:
172         - description-setter:
173             description: "Built on $NODE_NAME"
174         - '{project}-verify-{phase}-macro'
175
176 #####################################
177 # builder macros
178 #####################################
179 - builder:
180     name: 'daisy-verify-build-macro'
181     builders:
182         - shell:
183             !include-raw: ./daisy4nfv-basic.sh
184         - shell:
185             !include-raw: ./daisy4nfv-build.sh
186         - 'clean-workspace'
187
188 - builder:
189     name: daisy-verify-unit-macro
190     builders:
191         - shell: |
192             #!/bin/bash
193             set -o errexit
194             set -o pipefail
195             set -o xtrace
196             tox -e py27
197
198 #####################################
199 # parameter macros
200 #####################################
201 - parameter:
202     name: 'daisy4nfv-verify-defaults'
203     parameters:
204         - string:
205             name: BUILD_DIRECTORY
206             default: $WORKSPACE/build_output
207             description: "Directory where the build artifact will be located upon the completion of the build."
208         - string:
209             name: CACHE_DIRECTORY
210             default: $HOME/opnfv/cache/$INSTALLER_TYPE
211             description: "Directory where the cache to be used during the build is located."
212         - string:
213             name: GS_URL
214             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
215             description: "URL to Google Storage."