312b6ea8c7b69e1bfa2ea87c9fe11c65e3a44754
[releng/global-jjb.git] / jjb / lf-go-jobs.yaml
1 ##########
2 # Macros #
3 ##########
4
5 - builder:
6     name: lf-go-test
7     builders:
8       - inject:
9           properties-content: "GO_ROOT={go-root}"
10       - shell: !include-raw-escape: ../shell/go-test.sh
11
12 ####################
13 # COMMON FUNCTIONS #
14 ####################
15
16 - lf_go_common: &lf_go_common
17     name: lf-go-common
18
19     project-type: freestyle
20     node: "{build-node}"
21
22     ######################
23     # Default parameters #
24     ######################
25
26     branch: master
27     build-days-to-keep: 7
28     build-timeout: 60
29     disable-job: false
30     git-url: "$GIT_URL/$PROJECT"
31     github-url: "https://github.com"
32     stream: master
33     submodule-recursive: true
34     submodule-timeout: 10
35     submodule-disable: false
36
37     #####################
38     # Job Configuration #
39     #####################
40
41     disabled: "{disable-job}"
42
43     properties:
44       - lf-infra-properties:
45           build-days-to-keep: "{build-days-to-keep}"
46
47     parameters:
48       - lf-infra-parameters:
49           project: "{project}"
50           branch: "{branch}"
51           stream: "{stream}"
52
53     wrappers:
54       - lf-infra-wrappers:
55           build-timeout: "{build-timeout}"
56           jenkins-ssh-credential: "{jenkins-ssh-credential}"
57
58     publishers:
59       - lf-infra-publish
60
61 #############
62 # Go Verify #
63 #############
64
65 - lf_go_verify: &lf_go_verify
66     name: lf-go-verify
67
68     concurrent: true
69
70     gerrit_verify_triggers:
71       - patchset-created-event:
72           exclude-drafts: true
73           exclude-trivial-rebase: false
74           exclude-no-code-change: false
75       - draft-published-event
76       - comment-added-contains-event:
77           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
78
79     gerrit_trigger_file_paths:
80       - compare-type: REG_EXP
81         pattern: ".*"
82
83     # github_included_regions MUST match gerrit_trigger_file_paths
84     github_included_regions:
85       - ".*"
86
87     builders:
88       - lf-go-test:
89           go-root: "{go-root}"
90
91 - job-template:
92     name: "{project-name}-go-verify-{stream}"
93     id: gerrit-go-verify
94     <<: *lf_go_common
95     # yamllint disable-line rule:key-duplicates
96     <<: *lf_go_verify
97
98     scm:
99       - lf-infra-gerrit-scm:
100           jenkins-ssh-credential: "{jenkins-ssh-credential}"
101           git-url: "{git-url}"
102           refspec: "$GERRIT_REFSPEC"
103           branch: "$GERRIT_BRANCH"
104           submodule-disable: "{submodule-disable}"
105           submodule-recursive: "{submodule-recursive}"
106           submodule-timeout: "{submodule-timeout}"
107           choosing-strategy: gerrit
108
109     triggers:
110       - gerrit:
111           server-name: "{gerrit-server-name}"
112           trigger-on: "{obj:gerrit_verify_triggers}"
113           projects:
114             - project-compare-type: ANT
115               project-pattern: "{project}"
116               branches:
117                 - branch-compare-type: ANT
118                   branch-pattern: "**/{branch}"
119               file-paths: "{obj:gerrit_trigger_file_paths}"
120
121 - job-template:
122     name: "{project-name}-go-verify-{stream}"
123     id: github-go-verify
124     <<: *lf_go_common
125     # yamllint disable-line rule:key-duplicates
126     <<: *lf_go_verify
127
128     properties:
129       - github:
130           url: "{github-url}/{github-org}/{project}"
131
132     scm:
133       - lf-infra-github-scm:
134           url: "{git-clone-url}{github-org}/{project}"
135           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
136           branch: "$sha1"
137           submodule-recursive: "{submodule-recursive}"
138           submodule-timeout: "{submodule-timeout}"
139           submodule-disable: "{submodule-disable}"
140           choosing-strategy: default
141           jenkins-ssh-credential: "{jenkins-ssh-credential}"
142
143     triggers:
144       - github-pull-request:
145           trigger-phrase: "^(recheck|reverify)$"
146           only-trigger-phrase: true
147           status-context: "Go Verify"
148           permit-all: true
149           github-hooks: true
150           org-list:
151             - "{github-org}"
152           white-list: "{obj:github_pr_allowlist}"
153           admin-list: "{obj:github_pr_admin_list}"
154           white-list-target-branches:
155             - "{branch}"