4 name: opendaylight-infra-parameters
9 description: 'Parameter to identify an ODL Gerrit project'
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'
17 description: "GERRIT_PROJECT parameter if not given by trigger"
21 description: "JJB configured GERRIT_BRANCH parameter"
25 description: "GERRIT_REFSPEC parameter if not given by trigger"
33 description: 'Tag in Git to checkout'
36 name: controller-version-parameter
40 default: '{odl_version}'
41 description: 'Controller version (for use with openstacks networking_odl project)'
44 name: patches-to-build-parameter
47 name: PATCHES_TO_BUILD
49 description: 'csv list of patches in project:changeset format to build distribution with'
52 name: distribution-branch-to-build-parameter
55 name: DISTRIBUTION_BRANCH_TO_BUILD
57 description: 'distribution repo branch to build with'
65 description: 'Nexus staging profile id'
68 name: stage-id-parameter
71 name: STAGING_PROFILE_ID
73 description: 'Nexus staging profile id'
80 default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn'
81 description: 'Maven selector to be used by shell scripts'
87 credentials-id: 'opendaylight-jenkins-ssh'
96 name: git-scm-with-submodules
99 credentials-id: 'opendaylight-jenkins-ssh'
103 - 'refs/heads/{branch}'
110 name: gerrit-trigger-scm
113 credentials-id: 'opendaylight-jenkins-ssh'
117 - 'origin/$GERRIT_BRANCH'
119 choosing-strategy: '{choosing-strategy}'
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.
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
138 name: gerrit-trigger-patch-submitted
141 server-name: '{server}'
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'
151 - project-compare-type: 'ANT'
152 project-pattern: '{project}'
154 - branch-compare-type: 'ANT'
155 branch-pattern: '**/{branch}'
157 - compare-type: 'ANT'
160 # TODO: Unify argument names across gerrit-trigger-* macros.
162 name: gerrit-trigger-patch-merged
165 server-name: '{server-name}'
167 - change-merged-event
168 - comment-added-contains-event:
169 comment-contains-value: 'remerge'
171 - project-compare-type: 'ANT'
172 project-pattern: '{name}'
174 - branch-compare-type: 'ANT'
175 branch-pattern: '**/{branch}'
181 # Force Jenkins always vote the values it should already have voted
182 # during the prior verify phase
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
195 # TODO: Unify argument names across gerrit-trigger-* macros.
197 name: gerrit-trigger-patch-sonar
200 server-name: '{server-name}'
202 - comment-added-contains-event:
203 comment-contains-value: 'run-sonar'
205 - project-compare-type: 'ANT'
206 project-pattern: '{name}'
208 - branch-compare-type: 'ANT'
209 branch-pattern: '**/master'
217 name: archive-artifacts
220 artifacts: '{artifacts}'
226 name: email-notification
229 recipients: '{email-recipients}'
231 content-type: default
232 subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!'
234 $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS:
236 Check console output at $BUILD_URL to view the results.
246 exec-pattern: "**/**.exec"
247 class-pattern: "**/classes"
248 source-pattern: "**/src/main/java"
249 exclusion-pattern: "**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**"
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.
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.
269 # Also ensure that the workspace is cleaned up at the end of the build.
273 - shell: !include-raw: include-raw-deploy-archives.sh
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'
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
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'
297 name: wipe-org-opendaylight-repo
299 - shell: 'if [ -d /tmp/r/org/opendaylight ]; then rm -rf /tmp/r/org/opendaylight; fi'
302 name: wipe-local-maven-repo
304 - shell: 'if [ -d /tmp/r ]; then rm -rf /tmp/r; fi'
307 name: jacoco-nojava-workaround
309 - shell: 'mkdir -p $WORKSPACE/target/classes $WORKSPACE/jacoco/classes'
315 application-name: '{application-name}'
318 name: releng-check-unicode
321 $WORKSPACE/scripts/check-unicode.sh jjb/
324 name: provide-maven-settings
326 - config-file-provider:
328 - file-id: '{global-settings-file}'
329 variable: 'GLOBAL_SETTINGS_FILE'
330 - file-id: '{settings-file}'
331 variable: 'SETTINGS_FILE'
334 name: releng-fetch-p2zip-if-necessary
337 # Cleanup any existing zips and metadata before we download the new update site
340 condition-kind: strings-match
341 condition-string1: '$P2ZIP_URL'
342 condition-string2: ''
343 condition-basedir: workspace
345 # TODO: Figure out latest snapshot version number to pull rather than hardcoding 1.1.1-SNAPSHOT
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}'
353 name: releng-generate-p2pom
355 - shell: !include-raw: include-raw-generate-p2pom.sh
358 name: releng-update-p2composite-metadata
360 - shell: !include-raw: include-raw-update-p2composite-metadata.sh
362 condition-kind: file-exists
363 condition-filename: deploy-composite-repo.xml
364 condition-basedir: workspace
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}'
374 name: releng-stage-release
376 - shell: !include-raw: include-raw-stage-release.sh
379 # This wrapper is required for all jobs as it configures the wrappers
380 # needed by OpenDaylight infra.
381 name: opendaylight-infra-wrappers
385 timeout: '{build-timeout}'
386 timeout-var: 'BUILD_TIMEOUT'
389 - ssh-agent-credentials:
391 - 'opendaylight-jenkins-ssh'
398 name: packer-validate
400 - config-file-provider:
402 - file-id: 'packer-cloud-env'
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
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