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