blob: 1cca9140d2b762abbb1cea626a2d68e4dab5cd64 [file] [log] [blame]
Zack Williams7468c362018-04-06 09:52:30 -07001---
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 Williamsc27ca2d2018-04-11 13:16:45 -070018 manifest-url: '{manifest-url}'
Zack Williams7468c362018-04-06 09:52:30 -070019 manifest-branch: '{branch}'
20 destination-dir: '{destination-dir}'
21 jobs: 4
22 reset-first: true
23 depth: 1
24
Zack Williamsc27ca2d2018-04-11 13:16:45 -070025# download a specific patchset after checking out entire source tree with repo
Zack Williams7468c362018-04-06 09:52:30 -070026# 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 Williamsc27ca2d2018-04-11 13:16:45 -070032 DESTINATION_DIR={destination-dir}
Zack Williams7468c362018-04-06 09:52:30 -070033 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 Khalasi02cd79c2018-04-30 15:05:09 -070038# sonarqube-ongoing-coverage
39- builder:
40 name: cord-infra-sonarqube
41 builders:
Zack Williamsefc1cb92018-07-17 14:11:08 -070042 - inject:
43 properties-content: |
Zack Williams9d98e602018-07-17 15:11:31 -070044 SONAR_PREP_COMMANDS={sonar-prep-commands}
Zack Williamsefc1cb92018-07-17 14:11:08 -070045 - shell: !include-raw-escape: shell/sonarprep.sh
Kailash Khalasi02cd79c2018-04-30 15:05:09 -070046 - 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 Williams9d98e602018-07-17 15:11:31 -070053 sonar.java.binaries={sonar-java-binaries}
Kailash Khalasi02cd79c2018-04-30 15:05:09 -070054
Zack Williams7468c362018-04-06 09:52:30 -070055# 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 Williamse64341b2018-04-10 22:14:35 -070060 - 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 Williamsc27ca2d2018-04-11 13:16:45 -070078 file-paths:
79 - compare-type: REG_EXP
80 pattern: '{file-include-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070081
82# trigger on gerrit commits/merges
83- trigger:
84 name: cord-infra-gerrit-trigger-merge
85 triggers:
Zack Williamse64341b2018-04-10 22:14:35 -070086 - gerrit:
87 server-name: '{gerrit-server-name}'
88 dependency-jobs: '{dependency-jobs}'
Zack Williams9ac51db2018-04-16 16:44:24 -070089 silent-start: true
Zack Williamse64341b2018-04-10 22:14:35 -070090 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 Williamsc27ca2d2018-04-11 13:16:45 -070098 file-paths:
99 - compare-type: REG_EXP
100 pattern: '{file-include-regexp}'