Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 1 | --- |
| 2 | # Global macros |
| 3 | |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 4 | # vim: sw=2 ts=2 sts=2 et : |
| 5 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 6 | # BUILDERS |
| 7 | - builder: |
| 8 | name: ci-management-check-unicode |
| 9 | builders: |
| 10 | - shell: | |
| 11 | $WORKSPACE/scripts/check-unicode.sh jjb/ |
| 12 | |
| 13 | - builder: |
| 14 | name: provide-maven-settings |
| 15 | builders: |
| 16 | - config-file-provider: |
| 17 | files: |
| 18 | - file-id: '{global-settings-file}' |
| 19 | variable: 'GLOBAL_SETTINGS_FILE' |
| 20 | - file-id: '{settings-file}' |
| 21 | variable: 'SETTINGS_FILE' |
| 22 | |
Andrew Grimberg | 3aaa7d4 | 2017-02-24 12:51:11 -0800 | [diff] [blame] | 23 | # call maven-target builder with a goal of --version to force Jenkins to |
| 24 | # install the needed maven version |
| 25 | - builder: |
| 26 | name: maven-install |
| 27 | builders: |
| 28 | - maven-target: |
| 29 | maven-version: '{maven-version}' |
| 30 | goals: '--version' |
| 31 | |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 32 | - builder: |
| 33 | name: maven-docker-push-release |
| 34 | builders: |
| 35 | - maven-target: |
Andrew Grimberg | e246588 | 2017-02-24 12:38:05 -0800 | [diff] [blame] | 36 | maven-version: '{maven-version}' |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 37 | pom: '{pom}' |
Anaël Closson | 09b5903 | 2017-02-16 15:44:51 +0100 | [diff] [blame] | 38 | goals: 'clean deploy -B -P {mvn-profile}' |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 39 | settings: '{mvn-settings}' |
| 40 | settings-type: cfp |
| 41 | global-settings: 'global-settings' |
| 42 | global-settings-type: cfp |
| 43 | properties: |
| 44 | - maven.test.skip=true |
Jeremy Phelps | 48028ab | 2017-03-28 15:38:24 -0500 | [diff] [blame] | 45 | - docker.pull.registry=nexus3.onap.org:10001 |
| 46 | - docker.push.registry=nexus3.onap.org:10002 |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 47 | |
| 48 | - builder: |
| 49 | name: maven-docker-push-daily |
| 50 | builders: |
| 51 | - maven-target: |
Andrew Grimberg | e246588 | 2017-02-24 12:38:05 -0800 | [diff] [blame] | 52 | maven-version: '{maven-version}' |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 53 | pom: '{pom}' |
Anaël Closson | 09b5903 | 2017-02-16 15:44:51 +0100 | [diff] [blame] | 54 | goals: 'clean deploy -B -P {mvn-profile}' |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 55 | settings: '{mvn-settings}' |
| 56 | settings-type: cfp |
| 57 | global-settings: 'global-settings' |
| 58 | global-settings-type: cfp |
| 59 | properties: |
| 60 | - maven.test.skip=true |
Jeremy Phelps | 48028ab | 2017-03-28 15:38:24 -0500 | [diff] [blame] | 61 | - docker.pull.registry=nexus3.onap.org:10001 |
| 62 | - docker.push.registry=nexus3.onap.org:10003 |
Anaël Closson | abbafb5 | 2017-02-09 17:55:10 +0100 | [diff] [blame] | 63 | |
Anaël Closson | 63e090e | 2017-02-15 14:50:45 +0100 | [diff] [blame] | 64 | - builder: |
| 65 | name: docker-login |
| 66 | builders: |
| 67 | - shell: !include-raw: include-docker-login.sh |
| 68 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 69 | # PARAMETERS |
| 70 | - parameter: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 71 | name: infra-parameters |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 72 | parameters: |
| 73 | - string: |
| 74 | name: PROJECT |
| 75 | default: '{project}' |
| 76 | # yamllint disable rule:line-length |
| 77 | description: 'JJB configured PROJECT parameter to identify a Gerrit project' |
| 78 | # yamllint enable |
| 79 | - string: |
| 80 | name: ARCHIVE_ARTIFACTS |
| 81 | default: '{artifacts} **/target/surefire-reports/*-output.txt' |
| 82 | # yamllint disable rule:line-length |
| 83 | description: 'Space separated glob patterns for artifacts to archive to logs hosting' |
| 84 | # yamllint enable |
| 85 | - string: |
| 86 | name: GERRIT_BRANCH |
| 87 | default: '{branch}' |
| 88 | description: 'JJB configured GERRIT_BRANCH parameter' |
| 89 | - string: |
| 90 | name: GERRIT_PROJECT |
| 91 | default: '{project}' |
| 92 | description: 'GERRIT_PROJECT parameter if not given by trigger' |
| 93 | - string: |
| 94 | name: GERRIT_REFSPEC |
| 95 | default: '{refspec}' |
| 96 | description: 'GERRIT_REFSPEC parameter if not given by trigger' |
| 97 | - string: |
| 98 | name: STACK_NAME |
| 99 | default: '$JOB_NAME-$BUILD_NUMBER' |
| 100 | description: 'Used by Heat to generate a unique stack & vm name' |
| 101 | |
| 102 | - parameter: |
| 103 | name: maven-exec |
| 104 | parameters: |
| 105 | - string: |
| 106 | name: MVN |
| 107 | # yamllint disable rule:line-length |
| 108 | default: '/w/tools/hudson.tasks.Maven_MavenInstallation/{maven-version}/bin/mvn' |
| 109 | # yamllint enable |
| 110 | description: 'Maven selector to be used by shell scripts' |
| 111 | |
Gary Wu | dc3f295 | 2017-08-23 16:48:59 -0700 | [diff] [blame] | 112 | - parameter: |
| 113 | name: docker-image-name |
| 114 | parameters: |
| 115 | - string: |
| 116 | name: DOCKER_IMAGE_NAME |
| 117 | # yamllint disable rule:line-length |
| 118 | default: '{docker-image-name}' |
| 119 | # yamllint enable |
| 120 | description: 'Docker image name, e.g. onap/appc' |
| 121 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 122 | # PROPERTIES |
| 123 | - property: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 124 | name: infra-properties |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 125 | properties: |
| 126 | - build-discarder: |
| 127 | days-to-keep: '{build-days-to-keep}' |
| 128 | num-to-keep: 40 |
| 129 | artifact-days-to-keep: -1 |
| 130 | artifact-num-to-keep: 5 |
| 131 | |
| 132 | # PUBLISHERS |
| 133 | - publisher: |
| 134 | name: archive-artifacts |
| 135 | publishers: |
| 136 | - archive: |
| 137 | artifacts: '{artifacts}' |
| 138 | allow-empty: true |
| 139 | fingerprint: true |
| 140 | latest-only: true |
| 141 | |
| 142 | - publisher: |
| 143 | name: email-notification |
| 144 | publishers: |
| 145 | - email-ext: |
| 146 | recipients: 'nobody@open-o.org' |
| 147 | reply-to: |
| 148 | content-type: default |
| 149 | # yamllint disable rule:line-length |
| 150 | subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!' |
| 151 | # yamllint enable |
| 152 | body: | |
| 153 | $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS: |
| 154 | |
| 155 | Check console output at $BUILD_URL to view the results. |
| 156 | unstable: true |
| 157 | fixed: true |
| 158 | send-to: |
| 159 | - developers |
| 160 | - recipients |
| 161 | |
| 162 | - publisher: |
| 163 | name: jacoco-report |
| 164 | publishers: |
| 165 | - jacoco: |
| 166 | exec-pattern: '**/**.exec' |
| 167 | class-pattern: '**/classes' |
| 168 | source-pattern: '**/src/main/java' |
| 169 | # yamllint disable rule:line-length |
| 170 | exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**' |
| 171 | # yamllint enable |
| 172 | status-update: true |
| 173 | targets: |
| 174 | - branch: |
| 175 | healthy: 10 |
| 176 | unhealthy: 20 |
| 177 | - method: |
| 178 | healthy: 50 |
| 179 | unhealthy: 40 |
| 180 | |
| 181 | - publisher: |
JulienBe | 77903ed | 2017-07-17 15:30:26 +0200 | [diff] [blame] | 182 | name: checkstyle-result |
| 183 | publishers: |
| 184 | - checkstyle: |
| 185 | pattern: '**/checkstyle-result.xml' |
| 186 | healthy: 0 |
| 187 | unhealthy: 100 |
| 188 | health-threshold: 'high' |
| 189 | thresholds: |
| 190 | unstable: |
| 191 | total-all: 30 |
| 192 | total-high: 15 |
| 193 | total-normal: 20 |
| 194 | total-low: 25 |
| 195 | new-all: 5 |
| 196 | new-high: 0 |
| 197 | new-normal: 2 |
| 198 | new-low: 5 |
| 199 | |
| 200 | - publisher: |
| 201 | name: checkstyle-result-daily |
| 202 | publishers: |
| 203 | - checkstyle: |
| 204 | pattern: '**/checkstyle-result.xml' |
| 205 | healthy: 0 |
| 206 | unhealthy: 100 |
| 207 | health-threshold: 'high' |
| 208 | thresholds: |
| 209 | unstable: |
| 210 | total-all: 30 |
| 211 | total-high: 15 |
| 212 | total-normal: 20 |
| 213 | total-low: 25 |
| 214 | new-all: 1 |
| 215 | new-high: 0 |
| 216 | new-normal: 1 |
| 217 | new-low: 1 |
| 218 | |
| 219 | - publisher: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 220 | name: infra-shiplogs |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 221 | # To archive things, the job will need to create an "archives" directory in |
| 222 | # the workspace and this macro will handle copying the contents of the |
| 223 | # archives directory. |
| 224 | # |
| 225 | # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to |
| 226 | # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as |
| 227 | # the archive pattern. This is a space separated list of files to archive. |
| 228 | # |
| 229 | # Also ensure that the workspace is cleaned up at the end of the build. |
| 230 | publishers: |
| 231 | - postbuildscript: |
| 232 | builders: |
Andrew Grimberg | 8c8f8d5 | 2017-04-06 11:08:29 -0700 | [diff] [blame] | 233 | - shell: !include-raw-escape: include-raw-deploy-archives.sh |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 234 | - maven-target: |
| 235 | maven-version: '{maven-version}' |
| 236 | pom: '.archives/deploy-archives.xml' |
| 237 | goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r' |
| 238 | settings: 'jenkins-log-archives-settings' |
| 239 | settings-type: cfp |
| 240 | global-settings: 'global-settings' |
| 241 | global-settings-type: cfp |
| 242 | - description-setter: |
| 243 | regexp: '^Build logs: .*' |
| 244 | script-only-if-succeeded: false |
| 245 | script-only-if-failed: false |
| 246 | mark-unstable-if-failed: true |
| 247 | - workspace-cleanup: |
| 248 | fail-build: false` |
| 249 | |
| 250 | # SCMS |
| 251 | - scm: |
| 252 | name: git-scm |
| 253 | scm: |
| 254 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 255 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 256 | url: '$GIT_BASE' |
| 257 | refspec: '' |
| 258 | branches: |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 259 | - 'origin/{branch}' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 260 | skip-tag: true |
| 261 | wipe-workspace: true |
| 262 | timeout: 30 |
| 263 | |
| 264 | - scm: |
| 265 | name: gerrit-trigger-scm |
| 266 | scm: |
| 267 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 268 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 269 | url: '$GIT_BASE' |
| 270 | refspec: '{refspec}' |
| 271 | branches: |
| 272 | - 'origin/$GERRIT_BRANCH' |
| 273 | skip-tag: true |
| 274 | timeout: 30 |
| 275 | choosing-strategy: '{choosing-strategy}' |
Jeremy Phelps | 2c76e49 | 2017-07-12 13:45:40 -0500 | [diff] [blame] | 276 | submodule: |
| 277 | recursive: '{submodule-recursive}' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 278 | |
| 279 | - scm: |
| 280 | name: gerrit-trigger-scm-basedir |
| 281 | scm: |
| 282 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 283 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 284 | url: '$GIT_BASE' |
| 285 | refspec: '{refspec}' |
| 286 | branches: |
| 287 | - 'origin/$GERRIT_BRANCH' |
| 288 | skip-tag: true |
| 289 | timeout: 30 |
| 290 | choosing-strategy: '{choosing-strategy}' |
| 291 | basedir: '{basedir}' |
| 292 | |
| 293 | - scm: |
| 294 | name: git-branch-scm |
| 295 | scm: |
| 296 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 297 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 298 | url: '$GIT_BASE' |
| 299 | refspec: '' |
| 300 | branches: |
| 301 | - 'origin/{branch}' |
| 302 | skip-tag: true |
| 303 | timeout: 30 |
| 304 | wipe-workspace: true |
| 305 | |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 306 | - scm: |
| 307 | name: git-extra-project |
| 308 | scm: |
| 309 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 310 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 311 | url: '$GIT_NO_PROJECT/{project}' |
| 312 | refspec: '{refspec}' |
| 313 | branches: |
| 314 | - 'origin/{branch}' |
| 315 | skip-tag: true |
| 316 | timeoute: 30 |
| 317 | wipe-workspace: false |
| 318 | basedir: '{checkout-dir}' |
| 319 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 320 | # TRIGGERS |
| 321 | |
| 322 | # This is a single macro to use for all jobs who vote on every (relevant) patch |
| 323 | # set. Only 'recheck' trigger word is supported, it always triggers the full set |
| 324 | # of relevant jobs, in order to prevent Jenkins from starting only a subset and |
| 325 | # still voting Verified+1 |
| 326 | # Arguments: |
| 327 | # server: name of gerrit server to listen to |
| 328 | # project: pattern to match triggering projects |
| 329 | # branch: triggering branch name |
| 330 | # files: pattern to match triggering filepaths |
| 331 | - trigger: |
| 332 | name: gerrit-trigger-patch-submitted |
| 333 | triggers: |
| 334 | - gerrit: |
| 335 | server-name: '{server}' |
| 336 | trigger-on: |
| 337 | - patchset-created-event: |
| 338 | exclude-drafts: 'false' |
| 339 | exclude-trivial-rebase: 'false' |
| 340 | exclude-no-code-change: 'false' |
| 341 | - draft-published-event |
| 342 | - comment-added-contains-event: |
| 343 | comment-contains-value: 'recheck' |
| 344 | projects: |
| 345 | - project-compare-type: 'ANT' |
| 346 | project-pattern: '{project}' |
| 347 | branches: |
| 348 | - branch-compare-type: 'ANT' |
| 349 | branch-pattern: '**/{branch}' |
| 350 | file-paths: |
| 351 | - compare-type: 'ANT' |
| 352 | pattern: '{files}' |
| 353 | |
| 354 | - trigger: |
| 355 | name: gerrit-trigger-patch-merged |
| 356 | triggers: |
| 357 | - gerrit: |
| 358 | server-name: '{server}' |
| 359 | trigger-on: |
| 360 | - change-merged-event |
| 361 | - comment-added-contains-event: |
| 362 | comment-contains-value: 'remerge' |
| 363 | projects: |
| 364 | - project-compare-type: 'ANT' |
| 365 | project-pattern: '{project}' |
| 366 | branches: |
| 367 | - branch-compare-type: 'ANT' |
| 368 | branch-pattern: '**/{branch}' |
| 369 | file-paths: |
| 370 | - compare-type: 'ANT' |
| 371 | pattern: '{files}' |
| 372 | |
JulienBe | 0d8c2c3 | 2017-02-16 11:50:48 -0800 | [diff] [blame] | 373 | - trigger: |
| 374 | name: gerrit-trigger-release-manually |
| 375 | triggers: |
| 376 | - gerrit: |
| 377 | server-name: '{server}' |
| 378 | trigger-on: |
| 379 | - comment-added-contains-event: |
| 380 | comment-contains-value: 'please release' |
| 381 | projects: |
| 382 | - project-compare-type: 'ANT' |
| 383 | project-pattern: '{project}' |
| 384 | branches: |
| 385 | - branch-compare-type: 'ANT' |
| 386 | branch-pattern: '**/{branch}' |
| 387 | file-paths: |
| 388 | - compare-type: 'ANT' |
| 389 | pattern: '**' |
| 390 | |
Anaël Closson | adcb39d | 2017-03-10 15:39:09 +0100 | [diff] [blame] | 391 | - trigger: |
| 392 | name: trigger-on-build-success |
| 393 | triggers: |
Anaël Closson | 41ddffd | 2017-03-13 13:39:57 +0100 | [diff] [blame] | 394 | - reverse: |
| 395 | jobs: '{job-name}' |
| 396 | result: 'success' |
| 397 | |
Anaël Closson | adcb39d | 2017-03-10 15:39:09 +0100 | [diff] [blame] | 398 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 399 | # WRAPPERS |
| 400 | - wrapper: |
| 401 | name: build-timeout |
| 402 | wrappers: |
| 403 | - timeout: |
| 404 | type: absolute |
| 405 | timeout: 360 |
| 406 | fail: true |
| 407 | |
| 408 | - wrapper: |
| 409 | # This wrapper is required for all jobs as it configures the wrappers |
| 410 | # needed by the eCOMP infra. |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 411 | name: infra-wrappers |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 412 | wrappers: |
Jessica Wagantall | 4fecf31 | 2017-04-25 11:40:31 -0700 | [diff] [blame] | 413 | - timestamps |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 414 | - timeout: |
| 415 | type: absolute |
| 416 | timeout: '{build-timeout}' |
| 417 | timeout-var: 'BUILD_TIMEOUT' |
| 418 | fail: true |
| 419 | - ssh-agent-credentials: |
| 420 | users: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 421 | - 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 422 | - openstack: |
| 423 | single-use: true |