Fix verify job without patchset
[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     scm:
51         - git-scm-gerrit
52     wrappers:
53         - ssh-agent-wrapper
54         - timeout:
55             timeout: 360
56             fail: true
57     triggers:
58         - gerrit:
59             server-name: 'gerrit.opnfv.org'
60             trigger-on:
61                 - patchset-created-event:
62                     exclude-drafts: 'false'
63                     exclude-trivial-rebase: 'false'
64                     exclude-no-code-change: 'false'
65                 - draft-published-event
66                 - comment-added-contains-event:
67                     comment-contains-value: 'recheck'
68                 - comment-added-contains-event:
69                     comment-contains-value: 'reverify'
70             projects:
71                 - project-compare-type: 'ANT'
72                   project-pattern: '{project}'
73                   branches:
74                       - branch-compare-type: 'ANT'
75                         branch-pattern: '**/{branch}'
76                   file-paths:
77                       - compare-type: ANT
78                         pattern: 'ci/**'
79                       - compare-type: ANT
80                         pattern: 'code/**'
81                       - compare-type: ANT
82                         pattern: 'deploy/**'
83                   disable-strict-forbidden-file-verification: 'true'
84                   forbidden-file-paths:
85                       - compare-type: ANT
86                         pattern: 'docs/**'
87                       - compare-type: ANT
88                         pattern: '.gitignore'
89             readable-message: true
90
91     parameters:
92         - project-parameter:
93             project: '{project}'
94             branch: '{branch}'
95         - 'opnfv-build-centos-defaults'
96         - '{alias}-verify-defaults':
97             gs-pathname: '{gs-pathname}'
98
99     builders:
100         - description-setter:
101             description: "Built on $NODE_NAME"
102         - multijob:
103             name: unit
104             condition: SUCCESSFUL
105             projects:
106                 - name: '{alias}-verify-unit-{stream}'
107                   current-parameters: false
108                   predefined-parameters: |
109                     BRANCH=$BRANCH
110                     GERRIT_REFSPEC=$GERRIT_REFSPEC
111                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
112                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
113                   node-parameters: false
114                   kill-phase-on: FAILURE
115                   abort-all-job: true
116         - multijob:
117             name: build
118             condition: SUCCESSFUL
119             projects:
120                 - name: '{alias}-verify-build-{stream}'
121                   current-parameters: false
122                   predefined-parameters: |
123                     BRANCH=$BRANCH
124                     GERRIT_REFSPEC=$GERRIT_REFSPEC
125                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
126                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
127                   node-parameters: false
128                   kill-phase-on: FAILURE
129                   abort-all-job: true
130
131 - job-template:
132     name: '{alias}-verify-{phase}-{stream}'
133     disabled: '{obj:disabled}'
134     concurrent: true
135     properties:
136         - logrotate-default
137         - throttle:
138             enabled: true
139             max-total: 6
140             option: 'project'
141     scm:
142         - git-scm-gerrit
143     wrappers:
144         - ssh-agent-wrapper
145         - timeout:
146             timeout: 360
147             fail: true
148     parameters:
149         - project-parameter:
150             project: '{project}'
151             branch: '{branch}'
152         - '{slave-label}-defaults'
153         - '{alias}-verify-defaults':
154             gs-pathname: '{gs-pathname}'
155     builders:
156         - description-setter:
157             description: "Built on $NODE_NAME"
158         - '{project}-verify-{phase}-macro'
159
160 #####################################
161 # builder macros
162 #####################################
163 - builder:
164     name: 'daisy-verify-build-macro'
165     builders:
166         - shell:
167             !include-raw: ./daisy4nfv-basic.sh
168         - shell:
169             !include-raw: ./daisy4nfv-build.sh
170         - shell:
171             !include-raw: ./daisy4nfv-workspace-cleanup.sh
172
173 - builder:
174     name: daisy-verify-unit-macro
175     builders:
176         - shell: |
177             #!/bin/bash
178             set -o errexit
179             set -o pipefail
180             set -o xtrace
181             tox -e py27
182
183 #####################################
184 # parameter macros
185 #####################################
186 - parameter:
187     name: 'daisy4nfv-verify-defaults'
188     parameters:
189         - string:
190             name: BUILD_DIRECTORY
191             default: $WORKSPACE/build_output
192             description: "Directory where the build artifact will be located upon the completion of the build."
193         - string:
194             name: CACHE_DIRECTORY
195             default: $HOME/opnfv/cache/$INSTALLER_TYPE
196             description: "Directory where the cache to be used during the build is located."
197         - string:
198             name: GS_URL
199             default: artifacts.opnfv.org/$PROJECT{gs-pathname}
200             description: "URL to Google Storage."