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 | |
Kailash Khalasi | 02cd79c | 2018-04-30 15:05:09 -0700 | [diff] [blame] | 38 | # sonarqube-ongoing-coverage |
| 39 | - builder: |
| 40 | name: cord-infra-sonarqube |
| 41 | builders: |
Zack Williams | efc1cb9 | 2018-07-17 14:11:08 -0700 | [diff] [blame] | 42 | - inject: |
| 43 | properties-content: | |
Zack Williams | 9d98e60 | 2018-07-17 15:11:31 -0700 | [diff] [blame] | 44 | SONAR_PREP_COMMANDS={sonar-prep-commands} |
Zack Williams | efc1cb9 | 2018-07-17 14:11:08 -0700 | [diff] [blame] | 45 | - shell: !include-raw-escape: shell/sonarprep.sh |
Kailash Khalasi | 02cd79c | 2018-04-30 15:05:09 -0700 | [diff] [blame] | 46 | - sonar: |
| 47 | sonar-name: 'sonarqube.opencord.org' |
| 48 | java-opts: '-Xmx1280m' |
| 49 | properties: | |
| 50 | sonar.sources=. |
| 51 | sonar.projectKey={project}_$GERRIT_BRANCH |
| 52 | sonar.python.pylint=/usr/local/bin/pylint |
Zack Williams | 9d98e60 | 2018-07-17 15:11:31 -0700 | [diff] [blame] | 53 | sonar.java.binaries={sonar-java-binaries} |
Kailash Khalasi | 02cd79c | 2018-04-30 15:05:09 -0700 | [diff] [blame] | 54 | |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 55 | # trigger on gerrit patchsets and actions |
| 56 | # docs: https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit |
| 57 | - trigger: |
| 58 | name: cord-infra-gerrit-trigger-patchset |
| 59 | triggers: |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 60 | - gerrit: |
| 61 | server-name: '{gerrit-server-name}' |
| 62 | dependency-jobs: '{dependency-jobs}' |
| 63 | silent-start: true |
| 64 | trigger-on: |
| 65 | - patchset-created-event: |
| 66 | exclude-drafts: true |
| 67 | exclude-trivial-rebase: false |
| 68 | exclude-no-code-change: true |
| 69 | - draft-published-event |
| 70 | - comment-added-contains-event: |
| 71 | comment-contains-value: '(?i)^.*recheck$' |
| 72 | projects: |
| 73 | - project-compare-type: REG_EXP |
| 74 | project-pattern: '{project-regexp}' |
| 75 | branches: |
| 76 | - branch-compare-type: REG_EXP |
| 77 | branch-pattern: '{branch-regexp}' |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 78 | file-paths: |
| 79 | - compare-type: REG_EXP |
| 80 | pattern: '{file-include-regexp}' |
Zack Williams | 7468c36 | 2018-04-06 09:52:30 -0700 | [diff] [blame] | 81 | |
| 82 | # trigger on gerrit commits/merges |
| 83 | - trigger: |
| 84 | name: cord-infra-gerrit-trigger-merge |
| 85 | triggers: |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 86 | - gerrit: |
| 87 | server-name: '{gerrit-server-name}' |
| 88 | dependency-jobs: '{dependency-jobs}' |
Zack Williams | 9ac51db | 2018-04-16 16:44:24 -0700 | [diff] [blame] | 89 | silent-start: true |
Zack Williams | e64341b | 2018-04-10 22:14:35 -0700 | [diff] [blame] | 90 | trigger-on: |
| 91 | - change-merged-event |
| 92 | projects: |
| 93 | - project-compare-type: REG_EXP |
| 94 | project-pattern: '{project-regexp}' |
| 95 | branches: |
| 96 | - branch-compare-type: REG_EXP |
| 97 | branch-pattern: '{branch-regexp}' |
Zack Williams | c27ca2d | 2018-04-11 13:16:45 -0700 | [diff] [blame] | 98 | file-paths: |
| 99 | - compare-type: REG_EXP |
| 100 | pattern: '{file-include-regexp}' |