Merge "Update hst CPU/MemoryMB cloud config to limit jobs to 1 per server"
[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-patch-merged
115     triggers:
116         - gerrit:
117             server-name: 'Default'
118             trigger-on:
119                 - change-merged-event
120                 - comment-added-contains-event:
121                     comment-contains-value: 'remerge'
122             projects:
123                 - project-compare-type: 'ANT'
124                   project-pattern: '{name}'
125                   branches:
126                     - branch-compare-type: 'ANT'
127                       branch-pattern: '**/{branch}'
128
129 # Publishers
130 - publisher:
131     name: archive-artifacts
132     publishers:
133         - archive:
134             artifacts: '{artifacts}'
135             allow-empty: true
136             fingerprint: true
137             latest-only: true
138
139 - publisher:
140     name: email-notification
141     publishers:
142         - email-ext:
143             recipients: 'nobody@projectrotterdam.info'
144             reply-to:
145             content-type: default
146             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
147             body: |
148                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
149
150                 Check console output at $BUILD_URL to view the results.
151             unstable: true
152             fixed: true
153             send-to:
154                 - developers
155                 - recipients
156
157 - publisher:
158     name: jacoco-report
159     publishers:
160         - jacoco:
161             exec-pattern: '**/**.exec'
162             class-pattern: '**/classes'
163             source-pattern: '**/src/main/java'
164             exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**'
165             status-update: true
166             targets:
167                 - branch:
168                     healthy: 10
169                     unhealthy: 20
170                 - method:
171                     healthy: 50
172                     unhealthy: 40
173
174 ###### BUILDERS
175 - builder:
176     name: ci-management-check-unicode
177     builders:
178         - shell: |
179             $WORKSPACE/scripts/check-unicode.sh jjb/
180
181 - builder:
182     name: provide-maven-settings
183     builders:
184         - config-file-provider:
185             files:
186                 - file-id: '{global-settings-file}'
187                   variable: 'GLOBAL_SETTINGS_FILE'
188                 - file-id: '{settings-file}'
189                   variable: 'SETTINGS_FILE'
190