blob: 8e432168b026fd03f26cd49a75a8c5fc2c80690b [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
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 Williamse64341b2018-04-10 22:14:35 -070043 - 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 Williamsc27ca2d2018-04-11 13:16:45 -070061 file-paths:
62 - compare-type: REG_EXP
63 pattern: '{file-include-regexp}'
Zack Williams7468c362018-04-06 09:52:30 -070064
65# trigger on gerrit commits/merges
66- trigger:
67 name: cord-infra-gerrit-trigger-merge
68 triggers:
Zack Williamse64341b2018-04-10 22:14:35 -070069 - gerrit:
70 server-name: '{gerrit-server-name}'
71 dependency-jobs: '{dependency-jobs}'
72 silent-start: True
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 Williamsc27ca2d2018-04-11 13:16:45 -070081 file-paths:
82 - compare-type: REG_EXP
83 pattern: '{file-include-regexp}'