Add lf ci-management jjb jobs
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2 - job-group:
3     name: '{project-name}-ci-jobs'
4
5     # This job group contains all the recommended jobs that should be deployed
6     # for any project ci.
7
8     jjb-version: 1.6.2
9
10     jobs:
11       - '{project-name}-jjb-merge'
12       - '{project-name}-jjb-verify'
13
14 ####################
15 # Anchors & Macros #
16 ####################
17
18 - builder:
19     name: lf-infra-jjbini
20     builders:
21       - config-file-provider:
22           files:
23             - file-id: jjbini
24               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
25
26 - lf_jjb_file_paths: &lf_jjb_file_paths
27     name: lf-jjb-file-paths
28     file-paths:
29       - compare-type: ANT
30         pattern: '**/*.sh'
31       - compare-type: ANT
32         pattern: '**/*.yaml'
33
34 - parameter:
35     name: lf-infra-jjb-parameters
36     parameters:
37       - string:
38           name: JJB_VERSION
39           default: '{jjb-version}'
40           description: Jenkins Job Builder version to download and install.
41
42 #################
43 # Job Templates #
44 #################
45
46 - job-template:
47     name: '{project-name}-jjb-merge'
48     project-type: freestyle
49
50     node: '{build-node}'
51
52     ######################
53     # Default parameters #
54     ######################
55
56     branch: master
57     submodule-recursive: true
58
59     #####################
60     # Job Configuration #
61     #####################
62
63     properties:
64       - lf-infra-properties:
65           project: '{project}'
66           build-days-to-keep: 7
67
68     parameters:
69       - lf-infra-parameters:
70           project: '{project}'
71           branch: '{branch}'
72       - lf-infra-jjb-parameters:
73           jjb-version: '{jjb-version}'
74
75     scm:
76       - lf-infra-gerrit-scm:
77           jenkins-ssh-credential: '{jenkins-ssh-credential}'
78           refspec: ''
79           branch: '{branch}'
80           submodule-recursive: '{submodule-recursive}'
81           choosing-strategy: default
82
83     wrappers:
84       - lf-infra-wrappers:
85           build-timeout: 10
86           jenkins-ssh-credential: '{jenkins-ssh-credential}'
87
88     triggers:
89       - gerrit:
90           server-name: '{gerrit-server-name}'
91           trigger-on:
92             - change-merged-event
93             - comment-added-contains-event:
94                 comment-contains-value: ^remerge$
95           projects:
96             - project-compare-type: ANT
97               project-pattern: '{project}'
98               branches:
99                 - branch-compare-type: ANT
100                   branch-pattern: '**/{branch}'
101               <<: *lf_jjb_file_paths
102
103     builders:
104       - lf-infra-jjbini
105       - shell: !include-raw-escape:
106           - ../shell/jjb-install.sh
107           - ../shell/jjb-merge-job.sh
108
109     publishers:
110       - lf-infra-publish
111
112 - job-template:
113     name: '{project-name}-jjb-verify'
114     project-type: freestyle
115
116     node: '{build-node}'
117     concurrent: true
118
119     ######################
120     # Default parameters #
121     ######################
122
123     branch: master
124     submodule-recursive: true
125
126     #####################
127     # Job Configuration #
128     #####################
129
130     properties:
131       - lf-infra-properties:
132           project: '{project}'
133           build-days-to-keep: 7
134
135     parameters:
136       - lf-infra-parameters:
137           project: '{project}'
138           branch: '{branch}'
139       - lf-infra-jjb-parameters:
140           jjb-version: '{jjb-version}'
141
142     scm:
143       - lf-infra-gerrit-scm:
144           refspec: '$GERRIT_REFSPEC'
145           branch: '$GERRIT_BRANCH'
146           submodule-recursive: '{submodule-recursive}'
147           choosing-strategy: gerrit
148           jenkins-ssh-credential: '{jenkins-ssh-credential}'
149
150     wrappers:
151       - lf-infra-wrappers:
152           build-timeout: 10
153           jenkins-ssh-credential: '{jenkins-ssh-credential}'
154
155     triggers:
156       - gerrit:
157           server-name: '{gerrit-server-name}'
158           trigger-on:
159             - patchset-created-event:
160                 exclude-drafts: false
161                 exclude-trivial-rebase: false
162                 exclude-no-code-change: false
163             - draft-published-event
164             - comment-added-contains-event:
165                 comment-contains-value: ^recheck$
166           projects:
167             - project-compare-type: ANT
168               project-pattern: '{project}'
169               branches:
170                 - branch-compare-type: ANT
171                   branch-pattern: '**/{branch}'
172               <<: *lf_jjb_file_paths
173
174     builders:
175       - lf-infra-jjbini
176       - shell: !include-raw-escape:
177           - ../shell/jjb-install.sh
178           - ../shell/jjb-verify-job.sh
179           - ../shell/jjb-check-unicode.sh
180       - gpg-verify-git-signature
181
182     publishers:
183       - lf-infra-publish