removing netconf connector from netconf scale suite for carbon
[releng/builder.git] / jjb / releng-macros.yaml
1 # OLD Releng macros
2
3 - parameter:
4     name: opendaylight-infra-parameters
5     parameters:
6         - string:
7             name: PROJECT
8             default: '{project}'
9             description: 'Parameter to identify an ODL Gerrit project'
10         - string:
11             name: ARCHIVE_ARTIFACTS
12             default: '{artifacts} **/target/surefire-reports/*-output.txt'
13             description: 'Space separated glob patterns for artifacts to archive into logs.opendaylight.org'
14         - string:
15             name: GERRIT_PROJECT
16             default: '{project}'
17             description: "GERRIT_PROJECT parameter if not given by trigger"
18         - string:
19             name: GERRIT_BRANCH
20             default: '{branch}'
21             description: "JJB configured GERRIT_BRANCH parameter"
22         - string:
23             name: GERRIT_REFSPEC
24             default: '{refspec}'
25             description: "GERRIT_REFSPEC parameter if not given by trigger"
26
27 - parameter:
28     name: build-tag
29     parameters:
30         - string:
31             name: BUILD_TAG
32             default: ''
33             description: 'Tag in Git to checkout'
34
35 - parameter:
36     name: controller-version-parameter
37     parameters:
38         - string:
39             name: ODL_VERSION
40             default: '{odl_version}'
41             description: 'Controller version (for use with openstacks networking_odl project)'
42
43 - parameter:
44     name: patches-to-build-parameter
45     parameters:
46         - string:
47             name: PATCHES_TO_BUILD
48             default: ''
49             description: 'csv list of patches in project:changeset format to build distribution with'
50
51 - parameter:
52     name: distribution-branch-to-build-parameter
53     parameters:
54         - string:
55             name: DISTRIBUTION_BRANCH_TO_BUILD
56             default: 'master'
57             description: 'distribution repo branch to build with'
58
59 - parameter:
60     name: p2zip-parameter
61     parameters:
62         - string:
63             name: P2ZIP_URL
64             default: ''
65             description: 'Nexus staging profile id'
66
67 - parameter:
68     name: stage-id-parameter
69     parameters:
70         - string:
71             name: STAGING_PROFILE_ID
72             default: '{stage-id}'
73             description: 'Nexus staging profile id'
74
75 - parameter:
76     name: maven-exec
77     parameters:
78       - string:
79           name: MVN
80           default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
81           description: 'Maven selector to be used by shell scripts'
82
83 - scm:
84     name: git-scm
85     scm:
86         - git:
87             credentials-id: 'opendaylight-jenkins-ssh'
88             url: '$GIT_BASE'
89             refspec: ''
90             branches:
91                 - 'origin/{branch}'
92             skip-tag: true
93             wipe-workspace: true
94
95 - scm:
96     name: git-scm-with-submodules
97     scm:
98         - git:
99             credentials-id: 'opendaylight-jenkins-ssh'
100             url: '$GIT_BASE'
101             refspec: ''
102             branches:
103                 - 'refs/heads/{branch}'
104             skip-tag: true
105             wipe-workspace: true
106             submodule:
107                 recursive: true
108
109 - scm:
110     name: gerrit-trigger-scm
111     scm:
112         - git:
113             credentials-id: 'opendaylight-jenkins-ssh'
114             url: '$GIT_BASE'
115             refspec: '{refspec}'
116             branches:
117                 - 'origin/$GERRIT_BRANCH'
118             skip-tag: true
119             choosing-strategy: '{choosing-strategy}'
120
121 - wrapper:
122     name: build-timeout
123     wrappers:
124         - timeout:
125             type: absolute
126             timeout: 360
127             fail: true
128
129 # This is a single macro to use for all jobs who vote on every (relevant) patch set.
130 # Only 'recheck' trigger word is supported, it always triggers the full set of relevant jobs,
131 # in order to prevent Jenkins from starting only a subset and still voting Verified+1.
132 # Arguments:
133 #     server: name of gerrit server to listen to
134 #     project: pattern to match triggering projects
135 #     branch: triggering branch name
136 #     files: pattern to match triggering filepaths
137 - trigger:
138     name: gerrit-trigger-patch-submitted
139     triggers:
140         - gerrit:
141             server-name: '{server}'
142             trigger-on:
143                 - patchset-created-event:
144                     exclude-drafts: 'true'
145                     exclude-trivial-rebase: 'false'
146                     exclude-no-code-change: 'true'
147                 - draft-published-event
148                 - comment-added-contains-event:
149                     comment-contains-value: 'recheck'
150             projects:
151                 - project-compare-type: 'ANT'
152                   project-pattern: '{project}'
153                   branches:
154                       - branch-compare-type: 'ANT'
155                         branch-pattern: '**/{branch}'
156                   file-paths:
157                       - compare-type: 'ANT'
158                         pattern: '{files}'
159
160 # TODO: Unify argument names across gerrit-trigger-* macros.
161 - trigger:
162     name: gerrit-trigger-patch-merged
163     triggers:
164         - gerrit:
165             server-name: '{server-name}'
166             trigger-on:
167                 - change-merged-event
168                 - comment-added-contains-event:
169                     comment-contains-value: 'remerge'
170             projects:
171                 - project-compare-type: 'ANT'
172                   project-pattern: '{name}'
173                   branches:
174                       - branch-compare-type: 'ANT'
175                         branch-pattern: '**/{branch}'
176             skip-vote:
177                 successful: true
178                 failed: true
179                 unstable: true
180                 notbuilt: true
181             # Force Jenkins always vote the values it should already have voted
182             # during the prior verify phase
183             override-votes: true
184             gerrit-build-started-verified-value: 1
185             gerrit-build-successful-verified-value: 1
186             gerrit-build-failed-verified-value: 1
187             gerrit-build-unstable-verified-value: 1
188             gerrit-build-notbuilt-verified-value: 1
189             gerrit-build-started-codereview-value: 0
190             gerrit-build-successful-codereview-value: 0
191             gerrit-build-failed-codereview-value: 0
192             gerrit-build-unstable-codereview-value: 0
193             gerrit-build-notbuilt-codereview-value: 0
194
195 # TODO: Unify argument names across gerrit-trigger-* macros.
196 - trigger:
197     name: gerrit-trigger-patch-sonar
198     triggers:
199         - gerrit:
200             server-name: '{server-name}'
201             trigger-on:
202                 - comment-added-contains-event:
203                     comment-contains-value: 'run-sonar'
204             projects:
205               - project-compare-type: 'ANT'
206                 project-pattern: '{name}'
207                 branches:
208                   - branch-compare-type: 'ANT'
209                     branch-pattern: '**/master'
210             skip-vote:
211                 successful: true
212                 failed: true
213                 unstable: true
214                 notbuilt: true
215
216 - publisher:
217     name: archive-artifacts
218     publishers:
219         - archive:
220             artifacts: '{artifacts}'
221             allow-empty: true
222             fingerprint: true
223             latest-only: true
224
225 - publisher:
226     name: email-notification
227     publishers:
228         - email-ext:
229             recipients: '{email-recipients}'
230             reply-to: ''
231             content-type: default
232             subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
233             body: |
234                 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
235
236                 Check console output at $BUILD_URL to view the results.
237             unstable: true
238             fixed: true
239             send-to:
240                 - recipients
241
242 - publisher:
243         name: jacoco-report
244         publishers:
245             - jacoco:
246                 exec-pattern: "**/**.exec"
247                 class-pattern: "**/classes"
248                 source-pattern: "**/src/main/java"
249                 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
250                 status-update: true
251                 targets:
252                   - branch:
253                       healthy: 10
254                       unhealthy: 20
255                   - method:
256                       healthy: 50
257                       unhealthy: 40
258
259 - publisher:
260     name: opendaylight-infra-shiplogs
261     # To archive things the job will need to create a "archives" directory in
262     # the workspace and this macro will handle copying the contents of the
263     # archives directory.
264     #
265     # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files
266     # to archive. You can pass globstar patterns for example "**/*.xml **/*.log"
267     # as the archive pattern. This is a space separated list of files to archive.
268     #
269     # Also ensure that the workspace is cleaned up at the end of the build.
270     publishers:
271         - postbuildscript:
272             builders:
273                 - shell: !include-raw: include-raw-deploy-archives.sh
274                 - maven-target:
275                         maven-version: '{maven-version}'
276                         pom: '.archives/deploy-archives.xml'
277                         goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r'
278                         settings: 'jenkins-log-archives-settings'
279                         settings-type: cfp
280                         global-settings: 'odl-global-settings'
281                         global-settings-type: cfp
282                 - description-setter:
283                     regexp: '^Build logs: .*'
284                 # Cleanup after ourselves
285                 - wipe-org-opendaylight-repo
286             script-only-if-succeeded: False
287             script-only-if-failed: False
288             mark-unstable-if-failed: True
289         - workspace-cleanup:
290             exclude:
291               # Do not clean up *.jenkins-trigger files for jobs that use a
292               # properties file as input for triggering another build.
293               - '**/*.jenkins-trigger'
294             fail-build: false
295
296 - builder:
297     name: wipe-org-opendaylight-repo
298     builders:
299         - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
300
301 - builder:
302     name: wipe-local-maven-repo
303     builders:
304         - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
305
306 - builder:
307     name: jacoco-nojava-workaround
308     builders:
309         - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
310
311 - builder:
312     name: check-clm
313     builders:
314         - sonatype-clm:
315             application-name: '{application-name}'
316
317 - builder:
318     name: releng-check-unicode
319     builders:
320         - shell: |
321             $WORKSPACE/scripts/check-unicode.sh jjb/
322
323 - builder:
324     name: provide-maven-settings
325     builders:
326     - config-file-provider:
327         files:
328         - file-id: '{global-settings-file}'
329           variable: 'GLOBAL_SETTINGS_FILE'
330         - file-id: '{settings-file}'
331           variable: 'SETTINGS_FILE'
332
333 - builder:
334     name: releng-fetch-p2zip-if-necessary
335     builders:
336     - shell: |
337         # Cleanup any existing zips and metadata before we download the new update site
338         rm -f *.zip *.xml
339     - conditional-step:
340         condition-kind: strings-match
341         condition-string1: '$P2ZIP_URL'
342         condition-string2: ''
343         condition-basedir: workspace
344         steps:
345             # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
346             - maven-target:
347                 maven-version: '{maven-version}'
348                 goals: 'org.apache.maven.plugins:maven-dependency-plugin:get org.apache.maven.plugins:maven-dependency-plugin:copy -V -B -Dartifact=org.opendaylight.yangide:org.opendaylight.yangide.update-site:1.1.1-SNAPSHOT:zip -DoutputDirectory=$WORKSPACE'
349                 settings: '{settings}'
350                 global-settings: '{global-settings}'
351
352 - builder:
353     name: releng-generate-p2pom
354     builders:
355         - shell: !include-raw: include-raw-generate-p2pom.sh
356
357 - builder:
358     name: releng-update-p2composite-metadata
359     builders:
360     - shell: !include-raw: include-raw-update-p2composite-metadata.sh
361     - conditional-step:
362         condition-kind: file-exists
363         condition-filename: deploy-composite-repo.xml
364         condition-basedir: workspace
365         steps:
366             - maven-target:
367                 maven-version: '{maven-version}'
368                 pom: 'deploy-composite-repo.xml'
369                 goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
370                 settings: '{settings}'
371                 global-settings: '{global-settings}'
372
373 - builder:
374     name: releng-stage-release
375     builders:
376         - shell: !include-raw: include-raw-stage-release.sh
377
378 - wrapper:
379     # This wrapper is required for all jobs as it configures the wrappers
380     # needed by OpenDaylight infra.
381     name: opendaylight-infra-wrappers
382     wrappers:
383         - timeout:
384             type: absolute
385             timeout: '{build-timeout}'
386             timeout-var: 'BUILD_TIMEOUT'
387             fail: true
388         - timestamps
389         - ssh-agent-credentials:
390             users:
391                 - 'opendaylight-jenkins-ssh'
392         - jclouds:
393             single-use: True
394         - openstack:
395             single-use: True
396
397 - builder:
398     name: packer-validate
399     builders:
400         - config-file-provider:
401             files:
402                 - file-id: 'packer-cloud-env'
403                   variable: 'CLOUDENV'
404         - shell: |
405             cd packer
406             export PACKER_LOG="yes" && \
407             export PACKER_LOG_PATH="packer-validate.log" && \
408                         packer.io validate -var-file=$CLOUDENV \
409                          -var-file=../packer/vars/{platform}.json \
410                          ../packer/templates/{template}.json
411
412 - builder:
413     name: packer-build
414     builders:
415         - shell: |
416             cd packer
417             export PACKER_LOG="yes" && \
418             export PACKER_LOG_PATH="packer-build.log" && \
419                         packer.io build -var-file=$CLOUDENV \
420                          -var-file=../packer/vars/{platform}.json \
421                          ../packer/templates/{template}.json
422
423 - builder:
424     # TODO: Verify signature after downloading users public key from a locally created
425     # repository instead of the public keymesh. This requires a process in place to get ODL
426     # developers public keys into a local repository without increasing the job thoughput.
427     name: verify-gpg-signature
428     builders:
429         - shell: !include-raw: include-raw-verify-gpg-signatures.sh