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 | |
| 112 | # PROPERTIES |
| 113 | - property: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 114 | name: infra-properties |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 115 | properties: |
| 116 | - build-discarder: |
| 117 | days-to-keep: '{build-days-to-keep}' |
| 118 | num-to-keep: 40 |
| 119 | artifact-days-to-keep: -1 |
| 120 | artifact-num-to-keep: 5 |
| 121 | |
| 122 | # PUBLISHERS |
| 123 | - publisher: |
| 124 | name: archive-artifacts |
| 125 | publishers: |
| 126 | - archive: |
| 127 | artifacts: '{artifacts}' |
| 128 | allow-empty: true |
| 129 | fingerprint: true |
| 130 | latest-only: true |
| 131 | |
| 132 | - publisher: |
| 133 | name: email-notification |
| 134 | publishers: |
| 135 | - email-ext: |
| 136 | recipients: 'nobody@open-o.org' |
| 137 | reply-to: |
| 138 | content-type: default |
| 139 | # yamllint disable rule:line-length |
| 140 | subject: '{email-prefix} $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!' |
| 141 | # yamllint enable |
| 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 | # yamllint disable rule:line-length |
| 160 | exclusion-pattern: '**/gen**,**/generated-sources/**,**/yang-gen**,**/pax/**' |
| 161 | # yamllint enable |
| 162 | status-update: true |
| 163 | targets: |
| 164 | - branch: |
| 165 | healthy: 10 |
| 166 | unhealthy: 20 |
| 167 | - method: |
| 168 | healthy: 50 |
| 169 | unhealthy: 40 |
| 170 | |
| 171 | - publisher: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 172 | name: infra-shiplogs |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 173 | # To archive things, the job will need to create an "archives" directory in |
| 174 | # the workspace and this macro will handle copying the contents of the |
| 175 | # archives directory. |
| 176 | # |
| 177 | # Uses the build parameter ARCHIVE_ARTIFACTS if not empty to find files to |
| 178 | # archive. You can pass globstar patterns for example "**/*.xml **/*.log" as |
| 179 | # the archive pattern. This is a space separated list of files to archive. |
| 180 | # |
| 181 | # Also ensure that the workspace is cleaned up at the end of the build. |
| 182 | publishers: |
| 183 | - postbuildscript: |
| 184 | builders: |
Andrew Grimberg | 8c8f8d5 | 2017-04-06 11:08:29 -0700 | [diff] [blame] | 185 | - shell: !include-raw-escape: include-raw-deploy-archives.sh |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 186 | - maven-target: |
| 187 | maven-version: '{maven-version}' |
| 188 | pom: '.archives/deploy-archives.xml' |
| 189 | goals: 'clean deploy -V -B -q -Dmaven.repo.local=/tmp/r' |
| 190 | settings: 'jenkins-log-archives-settings' |
| 191 | settings-type: cfp |
| 192 | global-settings: 'global-settings' |
| 193 | global-settings-type: cfp |
| 194 | - description-setter: |
| 195 | regexp: '^Build logs: .*' |
| 196 | script-only-if-succeeded: false |
| 197 | script-only-if-failed: false |
| 198 | mark-unstable-if-failed: true |
| 199 | - workspace-cleanup: |
| 200 | fail-build: false` |
| 201 | |
| 202 | # SCMS |
| 203 | - scm: |
| 204 | name: git-scm |
| 205 | scm: |
| 206 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 207 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 208 | url: '$GIT_BASE' |
| 209 | refspec: '' |
| 210 | branches: |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 211 | - 'origin/{branch}' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 212 | skip-tag: true |
| 213 | wipe-workspace: true |
| 214 | timeout: 30 |
| 215 | |
| 216 | - scm: |
| 217 | name: gerrit-trigger-scm |
| 218 | scm: |
| 219 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 220 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 221 | url: '$GIT_BASE' |
| 222 | refspec: '{refspec}' |
| 223 | branches: |
| 224 | - 'origin/$GERRIT_BRANCH' |
| 225 | skip-tag: true |
| 226 | timeout: 30 |
| 227 | choosing-strategy: '{choosing-strategy}' |
Jeremy Phelps | 11f5d41 | 2017-06-30 13:56:19 -0500 | [diff] [blame] | 228 | submodule-recursive: '{submodule-recursive}' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 229 | |
| 230 | - scm: |
| 231 | name: gerrit-trigger-scm-basedir |
| 232 | scm: |
| 233 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 234 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 235 | url: '$GIT_BASE' |
| 236 | refspec: '{refspec}' |
| 237 | branches: |
| 238 | - 'origin/$GERRIT_BRANCH' |
| 239 | skip-tag: true |
| 240 | timeout: 30 |
| 241 | choosing-strategy: '{choosing-strategy}' |
| 242 | basedir: '{basedir}' |
| 243 | |
| 244 | - scm: |
| 245 | name: git-branch-scm |
| 246 | scm: |
| 247 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 248 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 249 | url: '$GIT_BASE' |
| 250 | refspec: '' |
| 251 | branches: |
| 252 | - 'origin/{branch}' |
| 253 | skip-tag: true |
| 254 | timeout: 30 |
| 255 | wipe-workspace: true |
| 256 | |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 257 | - scm: |
| 258 | name: git-extra-project |
| 259 | scm: |
| 260 | - git: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 261 | credentials-id: 'onap-jenkins-ssh' |
Andrew Grimberg | 1ac7c2d | 2017-02-08 12:40:56 -0800 | [diff] [blame] | 262 | url: '$GIT_NO_PROJECT/{project}' |
| 263 | refspec: '{refspec}' |
| 264 | branches: |
| 265 | - 'origin/{branch}' |
| 266 | skip-tag: true |
| 267 | timeoute: 30 |
| 268 | wipe-workspace: false |
| 269 | basedir: '{checkout-dir}' |
| 270 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 271 | # TRIGGERS |
| 272 | |
| 273 | # This is a single macro to use for all jobs who vote on every (relevant) patch |
| 274 | # set. Only 'recheck' trigger word is supported, it always triggers the full set |
| 275 | # of relevant jobs, in order to prevent Jenkins from starting only a subset and |
| 276 | # still voting Verified+1 |
| 277 | # Arguments: |
| 278 | # server: name of gerrit server to listen to |
| 279 | # project: pattern to match triggering projects |
| 280 | # branch: triggering branch name |
| 281 | # files: pattern to match triggering filepaths |
| 282 | - trigger: |
| 283 | name: gerrit-trigger-patch-submitted |
| 284 | triggers: |
| 285 | - gerrit: |
| 286 | server-name: '{server}' |
| 287 | trigger-on: |
| 288 | - patchset-created-event: |
| 289 | exclude-drafts: 'false' |
| 290 | exclude-trivial-rebase: 'false' |
| 291 | exclude-no-code-change: 'false' |
| 292 | - draft-published-event |
| 293 | - comment-added-contains-event: |
| 294 | comment-contains-value: 'recheck' |
| 295 | projects: |
| 296 | - project-compare-type: 'ANT' |
| 297 | project-pattern: '{project}' |
| 298 | branches: |
| 299 | - branch-compare-type: 'ANT' |
| 300 | branch-pattern: '**/{branch}' |
| 301 | file-paths: |
| 302 | - compare-type: 'ANT' |
| 303 | pattern: '{files}' |
| 304 | |
| 305 | - trigger: |
| 306 | name: gerrit-trigger-patch-merged |
| 307 | triggers: |
| 308 | - gerrit: |
| 309 | server-name: '{server}' |
| 310 | trigger-on: |
| 311 | - change-merged-event |
| 312 | - comment-added-contains-event: |
| 313 | comment-contains-value: 'remerge' |
| 314 | projects: |
| 315 | - project-compare-type: 'ANT' |
| 316 | project-pattern: '{project}' |
| 317 | branches: |
| 318 | - branch-compare-type: 'ANT' |
| 319 | branch-pattern: '**/{branch}' |
| 320 | file-paths: |
| 321 | - compare-type: 'ANT' |
| 322 | pattern: '{files}' |
| 323 | |
JulienBe | 0d8c2c3 | 2017-02-16 11:50:48 -0800 | [diff] [blame] | 324 | - trigger: |
| 325 | name: gerrit-trigger-release-manually |
| 326 | triggers: |
| 327 | - gerrit: |
| 328 | server-name: '{server}' |
| 329 | trigger-on: |
| 330 | - comment-added-contains-event: |
| 331 | comment-contains-value: 'please release' |
| 332 | projects: |
| 333 | - project-compare-type: 'ANT' |
| 334 | project-pattern: '{project}' |
| 335 | branches: |
| 336 | - branch-compare-type: 'ANT' |
| 337 | branch-pattern: '**/{branch}' |
| 338 | file-paths: |
| 339 | - compare-type: 'ANT' |
| 340 | pattern: '**' |
| 341 | |
Anaël Closson | adcb39d | 2017-03-10 15:39:09 +0100 | [diff] [blame] | 342 | - trigger: |
| 343 | name: trigger-on-build-success |
| 344 | triggers: |
Anaël Closson | 41ddffd | 2017-03-13 13:39:57 +0100 | [diff] [blame] | 345 | - reverse: |
| 346 | jobs: '{job-name}' |
| 347 | result: 'success' |
| 348 | |
Anaël Closson | adcb39d | 2017-03-10 15:39:09 +0100 | [diff] [blame] | 349 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 350 | # WRAPPERS |
| 351 | - wrapper: |
| 352 | name: build-timeout |
| 353 | wrappers: |
| 354 | - timeout: |
| 355 | type: absolute |
| 356 | timeout: 360 |
| 357 | fail: true |
| 358 | |
| 359 | - wrapper: |
| 360 | # This wrapper is required for all jobs as it configures the wrappers |
| 361 | # needed by the eCOMP infra. |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 362 | name: infra-wrappers |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 363 | wrappers: |
Jessica Wagantall | 4fecf31 | 2017-04-25 11:40:31 -0700 | [diff] [blame] | 364 | - timestamps |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 365 | - timeout: |
| 366 | type: absolute |
| 367 | timeout: '{build-timeout}' |
| 368 | timeout-var: 'BUILD_TIMEOUT' |
| 369 | fail: true |
| 370 | - ssh-agent-credentials: |
| 371 | users: |
Andrew Grimberg | 7d5be57 | 2017-03-16 12:33:21 -0700 | [diff] [blame] | 372 | - 'onap-jenkins-ssh' |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 373 | - openstack: |
| 374 | single-use: true |