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