Create autorelease GT for site patches
[releng/builder.git] / jjb / releng-macros.yaml
1 # OLD Releng macros
2
3 - parameter:
4     name: project-parameter
5     parameters:
6         - string:
7             name: PROJECT
8             default: '{project}'
9             description: "JJB configured PROJECT parameter to identify an ODL Gerrit project"
10
11 - parameter:
12     name: gerrit-parameter
13     parameters:
14         - string:
15             name: GERRIT_BRANCH
16             default: '{branch}'
17             description: "JJB configured GERRIT_BRANCH parameter"
18
19 - scm:
20     name: git-scm
21     scm:
22         - git:
23             credentials-id: '{credentials-id}'
24             url: '$GIT_BASE'
25             refspec: ''
26             branches:
27                 - 'origin/{branch}'
28             skip-tag: true
29             wipe-workspace: true
30
31 - scm:
32     name: gerrit-trigger-scm
33     scm:
34         - git:
35             credentials-id: '{credentials-id}'
36             url: '$GIT_BASE'
37             refspec: '{refspec}'
38             branches:
39                 - 'origin/$GERRIT_BRANCH'
40             skip-tag: true
41             choosing-strategy: '{choosing-strategy}'
42
43 - wrapper:
44     name: build-timeout
45     wrappers:
46         - timeout:
47             type: absolute
48             timeout: 360
49             fail: true
50
51 - trigger:
52     name: gerrit-trigger-patch-submitted
53     triggers:
54         - gerrit:
55             server-name: 'OpenDaylight'
56             trigger-on:
57                 - patchset-created-event:
58                     exclude-drafts: 'false'
59                     exclude-trivial-rebase: 'false'
60                     exclude-no-code-change: 'false'
61                 - draft-published-event
62                 - comment-added-contains-event:
63                     comment-contains-value: 'recheck'
64                 - comment-added-contains-event:
65                     comment-contains-value: 'reverify'
66             projects:
67               - project-compare-type: 'ANT'
68                 project-pattern: '{name}'
69                 branches:
70                   - branch-compare-type: 'ANT'
71                     branch-pattern: '**/{branch}'
72
73 - trigger:
74     name: gerrit-trigger-patch-merged
75     triggers:
76         - gerrit:
77             server-name: 'OpenDaylight'
78             trigger-on:
79                 - change-merged-event
80                 - comment-added-contains-event:
81                     comment-contains-value: 'remerge'
82             projects:
83               - project-compare-type: 'ANT'
84                 project-pattern: '{name}'
85                 branches:
86                   - branch-compare-type: 'ANT'
87                     branch-pattern: '**/{branch}'
88
89 - trigger:
90     name: gerrit-trigger-patch-sonar
91     triggers:
92         - gerrit:
93             server-name: 'OpenDaylight'
94             trigger-on:
95                 - comment-added-contains-event:
96                     comment-contains-value: 'run-sonar'
97             projects:
98               - project-compare-type: 'ANT'
99                 project-pattern: '{name}'
100                 branches:
101                   - branch-compare-type: 'ANT'
102                     branch-pattern: '**/master'
103             skip-vote:
104                 successful: true
105                 failed: true
106                 unstable: true
107                 notbuilt: true
108
109 - trigger:
110     name: gerrit-trigger-patch-site-merged
111     triggers:
112         - gerrit:
113             server-name: 'OpenDaylight'
114             trigger-on:
115                 - change-merged-event
116                 - comment-added-contains-event:
117                     comment-contains-value: 'republish'
118             projects:
119               - project-compare-type: 'ANT'
120                 project-pattern: '{name}'
121                 branches:
122                     - branch-compare-type: 'ANT'
123                       branch-pattern: '**/{branch}'
124
125 - publisher:
126     name: archive-artifacts
127     publishers:
128         - archive:
129             artifacts: '{artifacts}'
130             allow-empty: true
131             fingerprint: true
132             latest-only: true
133
134 - publisher:
135     name: email-notification
136     publishers:
137         - email-ext:
138             recipients: 'jenkins@lists.opendaylight.org'
139             reply-to:
140             content-type: default
141             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
142             body: |
143                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
144
145                 Check console output at $BUILD_URL to view the results.
146             unstable: true
147             fixed: true
148             send-to:
149                 - developers
150                 - recipients
151
152 - publisher:
153         name: jacoco-report
154         publishers:
155             - jacoco:
156                 exec-pattern: "**/**.exec"
157                 class-pattern: "**/classes"
158                 source-pattern: "**/src/main/java"
159                 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
160                 status-update: true
161                 targets:
162                   - branch:
163                       healthy: 10
164                       unhealthy: 20
165                   - method:
166                       healthy: 50
167                       unhealthy: 40
168
169 - builder:
170     name: wipe-org-opendaylight-repo
171     builders:
172         - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
173
174 - builder:
175     name: jacoco-nojava-workaround
176     builders:
177         - shell: 'mkdir -p $WORKSPACE/target/classes'
178
179 - builder:
180     name: check-clm
181     builders:
182         - sonatype-clm:
183             application-name: '{application-name}'
184             scan-targets: '**/target/**'
185
186 - builder:
187     name: releng-check-unicode
188     builders:
189         - shell: |
190             $WORKSPACE/scripts/check-unicode.sh jjb/
191
192 - builder:
193     name: provide-maven-settings
194     builders:
195     - config-file-provider:
196         files:
197         - file-id: '{global-settings-file}'
198           variable: 'GLOBAL_SETTINGS_FILE'
199         - file-id: '{settings-file}'
200           variable: 'SETTINGS_FILE'