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