Merge "Use tagging instead of branching for csit-verified"
[ci-management.git] / jjb / global-macros.yaml
1 # Global macros
2
3 #### PARAMETERS
4 - parameter:
5     name: project-parameter
6     parameters:
7         - string:
8             name: PROJECT
9             default: '{project}'
10             description: "JJB configured PROJECT parameter to identify a Gerrit project"
11
12 - parameter:
13     name: gerrit-parameter
14     parameters:
15         - string:
16             name: GERRIT_BRANCH
17             default: '{branch}'
18             description: "JJB configured GERRIT_BRANCH parameter"
19
20 - parameter:
21     name: gerrit-project-parameter
22     parameters:
23         - string:
24             name: GERRIT_PROJECT
25             default: '{project}'
26             description: "GERRIT_PROJECT parameter if not given by trigger"
27
28 - parameter:
29     name: gerrit-refspec-parameter
30     parameters:
31         - string:
32             name: GERRIT_REFSPEC
33             default: '{refspec}'
34             description: "GERRIT_REFSPEC parameter not given by trigger"
35
36 - parameter:
37     name: maven-project-parameter
38     parameters:
39         - string:
40             name: MAVEN_SELECTOR
41             default: '{maven}'
42             description: 'Maven selector to be used by shell scripts'
43
44
45 ##### SCMS
46 - scm:
47     name: git-scm
48     scm:
49         - git:
50             credentials-id: '{credentials-id}'
51             url: '$GIT_BASE'
52             refspec: ''
53             branches:
54                 - 'origin/{branch}'
55             skip-tag: true
56             wipe-workspace: true
57
58 - scm:
59     name: gerrit-trigger-scm
60     scm:
61         - git:
62             credentials-id: '{credentials-id}'
63             url: '$GIT_BASE'
64             refspec: '{refspec}'
65             branches:
66                 - 'origin/$GERRIT_BRANCH'
67             skip-tag: true
68             choosing-strategy: '{choosing-strategy}'
69
70 - scm:
71     name: zuul-trigger-scm
72     scm:
73       - git:
74           url: '$ZUUL_URL/$ZUUL_PROJECT'
75           refspec: '{refspec}'
76           branches:
77             - '{commit}'
78           skip-tag: true
79           wipe-workspace: true
80
81 ###### WRAPPERS
82 - wrapper:
83     name: build-timeout
84     wrappers:
85         - timeout:
86             type: absolute
87             timeout: 360
88             fail: true
89
90 ###### TRIGGERS
91 - trigger:
92     name: gerrit-trigger-patch-submitted
93     triggers:
94         - gerrit:
95             server-name: 'Default'
96             trigger-on:
97                 - patchset-created-event:
98                     exclude-drafts: 'false'
99                     exclude-trivial-rebase: 'false'
100                     exclude-no-code-change: 'false'
101                 - draft-published-event
102                 - comment-added-contains-event:
103                     comment-contains-value: 'recheck'
104                 - comment-added-contains-event:
105                     comment-contains-value: 'reverify'
106             projects:
107                 - project-compare-type: 'ANT'
108                   project-pattern: '{name}'
109                   branches:
110                     - branch-compare-type: 'ANT'
111                       branch-pattern: '**/{branch}'
112
113 - trigger:
114     name: gerrit-trigger-manually-triggered
115     triggers:
116         - gerrit:
117             server-name: 'Default'
118             trigger-on:
119                 - comment-added-contains-event:
120                     comment-contains-value: '{comment-trigger-value}'
121             projects:
122                 - project-compare-type: 'ANT'
123                   project-pattern: '{name}'
124                   branches:
125                     - branch-compare-type: 'ANT'
126                       branch-pattern: '**/{branch}'
127
128 - trigger:
129     name: gerrit-trigger-patch-merged
130     triggers:
131         - gerrit:
132             server-name: 'Default'
133             trigger-on:
134                 - change-merged-event
135                 - comment-added-contains-event:
136                     comment-contains-value: 'remerge'
137             projects:
138                 - project-compare-type: 'ANT'
139                   project-pattern: '{name}'
140                   branches:
141                     - branch-compare-type: 'ANT'
142                       branch-pattern: '**/{branch}'
143
144 # Publishers
145 - publisher:
146     name: archive-artifacts
147     publishers:
148         - archive:
149             artifacts: '{artifacts}'
150             allow-empty: true
151             fingerprint: true
152             latest-only: true
153
154 - publisher:
155     name: email-notification
156     publishers:
157         - email-ext:
158             recipients: 'nobody@projectrotterdam.info'
159             reply-to:
160             content-type: default
161             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
162             body: |
163                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
164
165                 Check console output at $BUILD_URL to view the results.
166             unstable: true
167             fixed: true
168             send-to:
169                 - developers
170                 - recipients
171
172 - publisher:
173     name: jacoco-report
174     publishers:
175         - jacoco:
176             exec-pattern: '**/**.exec'
177             class-pattern: '**/classes'
178             source-pattern: '**/src/main/java'
179             exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
180             status-update: true
181             targets:
182                 - branch:
183                     healthy: 10
184                     unhealthy: 20
185                 - method:
186                     healthy: 50
187                     unhealthy: 40
188
189 - publisher:
190     name: robot-report
191     publishers:
192         - robot:
193             output-path: '{output-path}'
194             other-files: ''
195
196 ###### BUILDERS
197 - builder:
198     name: ci-management-check-unicode
199     builders:
200         - shell: |
201             $WORKSPACE/scripts/check-unicode.sh jjb/
202
203 - builder:
204     name: provide-maven-settings
205     builders:
206         - config-file-provider:
207             files:
208                 - file-id: '{global-settings-file}'
209                   variable: 'GLOBAL_SETTINGS_FILE'
210                 - file-id: '{settings-file}'
211                   variable: 'SETTINGS_FILE'
212