Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 1 | --- |
| 2 | # CORD JJB macros |
| 3 | |
| 4 | # control how long builds and artifact are retained |
| 5 | - property: |
| 6 | name: cord-infra-properties |
| 7 | properties: |
| 8 | - build-discarder: |
| 9 | days-to-keep: '{build-days-to-keep}' |
| 10 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 11 | |
| 12 | # checkout entire source tree with repo |
| 13 | # docs: https://docs.openstack.org/infra/jenkins-job-builder/scm.html#scm.repo |
| 14 | - scm: |
| 15 | name: cord-infra-gerrit-repo-scm |
| 16 | scm: |
| 17 | - repo: |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 18 | manifest-url: '{manifest-url}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 19 | manifest-branch: '{branch}' |
| 20 | destination-dir: '{destination-dir}' |
| 21 | jobs: 4 |
| 22 | reset-first: true |
| 23 | depth: 1 |
| 24 | |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 25 | # download a specific patchset after checking out entire source tree with repo |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 26 | # docs: https://docs.openstack.org/infra/jenkins-job-builder/builders.html#builders.inject |
| 27 | - builder: |
| 28 | name: cord-infra-gerrit-repo-patch |
| 29 | builders: |
| 30 | - inject: |
| 31 | properties-content: | |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 32 | DESTINATION_DIR={destination-dir} |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 33 | GERRIT_PROJECT={project} |
| 34 | GERRIT_CHANGE_NUMBER={change-number} |
| 35 | GERRIT_PATCHSET_NUMBER={patchset-number} |
| 36 | - shell: !include-raw-escape: shell/repopatch.sh |
| 37 | |
| 38 | # trigger on gerrit patchsets and actions |
| 39 | # docs: https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit |
| 40 | - trigger: |
| 41 | name: cord-infra-gerrit-trigger-patchset |
| 42 | triggers: |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 43 | - gerrit: |
| 44 | server-name: '{gerrit-server-name}' |
| 45 | dependency-jobs: '{dependency-jobs}' |
| 46 | silent-start: true |
| 47 | trigger-on: |
| 48 | - patchset-created-event: |
| 49 | exclude-drafts: true |
| 50 | exclude-trivial-rebase: false |
| 51 | exclude-no-code-change: true |
| 52 | - draft-published-event |
| 53 | - comment-added-contains-event: |
| 54 | comment-contains-value: '(?i)^.*recheck$' |
| 55 | projects: |
| 56 | - project-compare-type: REG_EXP |
| 57 | project-pattern: '{project-regexp}' |
| 58 | branches: |
| 59 | - branch-compare-type: REG_EXP |
| 60 | branch-pattern: '{branch-regexp}' |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 61 | file-paths: |
| 62 | - compare-type: REG_EXP |
| 63 | pattern: '{file-include-regexp}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 64 | |
| 65 | # trigger on gerrit commits/merges |
| 66 | - trigger: |
| 67 | name: cord-infra-gerrit-trigger-merge |
| 68 | triggers: |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 69 | - gerrit: |
| 70 | server-name: '{gerrit-server-name}' |
| 71 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 9ac51db | 2018-04-16 16:44:24 -0700 | [diff] [blame] | 72 | silent-start: true |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 73 | trigger-on: |
| 74 | - change-merged-event |
| 75 | projects: |
| 76 | - project-compare-type: REG_EXP |
| 77 | project-pattern: '{project-regexp}' |
| 78 | branches: |
| 79 | - branch-compare-type: REG_EXP |
| 80 | branch-pattern: '{branch-regexp}' |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 81 | file-paths: |
| 82 | - compare-type: REG_EXP |
| 83 | pattern: '{file-include-regexp}' |