[CPS] Jobs for newdelhi branch
[ci-management.git] / jjb / global-templates-golang.yaml
1 ---
2 - job-template: &verify_golang_bolierplate
3     # Job template for Golang verify jobs
4     #
5     # The purpose of this job template is to run:
6     # 1. make build
7     #
8     # golangver can be set to golang110, golang111 or golang112
9     # depending on what version is needed by the project
10     # default is golang110
11     #
12     # Required Variables:
13     #     branch:    git branch (eg. stable/lithium or master)
14     #
15     # Optional Variables:
16     #     script:    build script to execute
17     #     pattern:   ant file-path pattern relative to the workspace used to
18     #                trigger the job
19
20     name: "{project-name}-{stream}-verify-golang"
21     path: "$WORKSPACE"
22     pattern: "**"
23     script: ""
24     golangver: "golang110"
25
26     project-type: freestyle
27     concurrent: true
28     node: "{build-node}"
29
30     properties:
31       - infra-properties:
32           build-days-to-keep: "{build-days-to-keep}"
33
34     parameters:
35       - infra-parameters:
36           project: "{project}"
37           branch: "{branch}"
38           refspec: "refs/heads/{branch}"
39           artifacts: "{archive-artifacts}"
40
41     scm:
42       - gerrit-trigger-scm:
43           refspec: "$GERRIT_REFSPEC"
44           choosing-strategy: "gerrit"
45           submodule-recursive: "{submodule-recursive}"
46
47     wrappers:
48       - "{golangver}"
49       - infra-wrappers:
50           build-timeout: "{build-timeout}"
51
52     triggers:
53       - gerrit-trigger-patch-submitted:
54           server: "{server-name}"
55           project: "{project}"
56           branch: "{branch}"
57           files: "{pattern}"
58
59     builders:
60       - lf-infra-pre-build
61       - provide-maven-settings:
62           global-settings-file: "global-settings"
63           settings-file: "{mvn-settings}"
64       - shell: |
65           #!/bin/bash
66           cd $WORKSPACE/{path}
67           make build
68       - shell: "{script}"
69
70     publishers:
71       - lf-infra-publish
72
73 - job-template:
74     # Job template for Golang verify jobs with subproject support
75
76     <<: *verify_golang_bolierplate
77     name: "{project-name}-{stream}-{subproject}-verify-golang"
78
79 - job-template:
80     # Job template for Golang merge jobs
81     #
82     # The purpose of this job template is to run:
83     # 1. make deploy
84     #
85     # golangver can be set to golang110 or golang111
86     # depending on what version is needed by the project
87     # default is golang110
88     #
89     # Required Variables:
90     #     branch:    git branch (eg. stable/lithium or master)
91
92     name: "{project-name}-{stream}-merge-golang"
93     path: $WORKSPACE
94     golangver: "golang110"
95
96     project-type: freestyle
97     node: "{build-node}"
98
99     properties:
100       - infra-properties:
101           build-days-to-keep: "{build-days-to-keep}"
102
103     parameters:
104       - infra-parameters:
105           project: "{project}"
106           branch: "{branch}"
107           refspec: "refs/heads/{branch}"
108           artifacts: "{archive-artifacts}"
109       - maven-exec:
110           maven-version: "{maven-version}"
111
112     scm:
113       - gerrit-trigger-scm:
114           refspec: ""
115           choosing-strategy: "default"
116           submodule-recursive: "{submodule-recursive}"
117
118     wrappers:
119       - "{golangver}"
120       - infra-wrappers:
121           build-timeout: "{build-timeout}"
122
123     triggers:
124       - gerrit-trigger-patch-merged:
125           server: "{server-name}"
126           project: "{project}"
127           branch: "{branch}"
128           files: "**"
129
130     builders:
131       - lf-infra-pre-build
132       - provide-maven-settings:
133           global-settings-file: "global-settings"
134           settings-file: "{mvn-settings}"
135       - shell: |
136           #!/bin/bash
137           cd $WORKSPACE/{path}
138           make deploy
139
140     publishers:
141       - lf-infra-publish
142
143 - job-template:
144     # Job template for building & pushing docker images
145     #
146     # golangver can be set to golang110 or golang111
147     # depending on what version is needed by the project
148     # default is golang110
149     #
150     # The purpose of this job template is to run:
151     #  1. login to the docker registry
152     #  2. run a specified shell builder
153     #
154
155     name: "{project-name}-{stream}-docker-golang-shell-daily"
156     golangver: "golang110"
157     project-type: freestyle
158     node: "ubuntu1804-docker-8c-8g"
159     disabled: false
160     properties:
161       - infra-properties:
162           build-days-to-keep: "{build-days-to-keep}"
163
164     parameters:
165       - infra-parameters:
166           project: "{project}"
167           branch: "{branch}"
168           refspec: "refs/heads/{branch}"
169           artifacts: "{archive-artifacts}"
170     scm:
171       - gerrit-trigger-scm:
172           refspec: ""
173           choosing-strategy: "default"
174           submodule-recursive: "{submodule-recursive}"
175
176     wrappers:
177       - "{golangver}"
178       - infra-wrappers:
179           build-timeout: "{build-timeout}"
180
181     triggers:
182       # 12 AM UTC
183       - gerrit-trigger-release-manually:
184           server: "{server-name}"
185           project: "{project}"
186           branch: "{branch}"
187
188     builders:
189       - lf-infra-pre-build
190       - provide-maven-settings:
191           global-settings-file: "global-settings"
192           settings-file: "{mvn-settings}"
193
194       - docker-login
195
196       - shell: "{script}"
197
198     publishers:
199       - lf-infra-publish