blob: 8b3e6597e28d237ee1b37e97420a1c0c6edf69ff [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:
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 Williams7468c362018-04-06 09:52:30 -070051# 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 Williamse64341b2018-04-10 22:14:35 -070056 - 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 Williamsc27ca2d2018-04-11 13:16:45 -070074 file-paths:
75 - compare-type: REG_EXP
76 pattern: '{file-include-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070077
78# trigger on gerrit commits/merges
79- trigger:
80 name: cord-infra-gerrit-trigger-merge
81 triggers:
Zack Williamse64341b2018-04-10 22:14:35 -070082 - gerrit:
83 server-name: '{gerrit-server-name}'
84 dependency-jobs: '{dependency-jobs}'
Zack Williams9ac51db2018-04-16 16:44:24 -070085 silent-start: true
Zack Williamse64341b2018-04-10 22:14:35 -070086 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 Williamsc27ca2d2018-04-11 13:16:45 -070094 file-paths:
95 - compare-type: REG_EXP
96 pattern: '{file-include-regexp}'