5 - docker_job_boiler_plate: &docker_job_boiler_plate
6 name: docker_job_boiler_plate
8 project-type: freestyle
11 ######################
12 # Default parameters #
13 ######################
16 submodule-recursive: true
18 # default params for docker jobs
21 docker_root: '$WORKSPACE'
23 docker_name: 'unnamed'
24 # Default to LF standard 'snapshots' docker registry
25 docker_registry: '$DOCKER_REGISTRY:10003'
33 - lf-infra-properties:
34 build-days-to-keep: '{build-days-to-keep}'
37 - lf-infra-parameters:
41 lftools-version: '{lftools-version}'
45 build-timeout: '{build-timeout}'
46 jenkins-ssh-credential: '{jenkins-ssh-credential}'
51 - docker_verify_boiler_plate: &docker_verify_boiler_plate
52 name: docker_verify_boiler_plate
58 refspec: '$GERRIT_REFSPEC'
59 choosing-strategy: 'default'
60 submodule-recursive: '{submodule-recursive}'
63 - gerrit-trigger-patch-submitted:
64 status-context: '{project}-Docker-Verify'
65 server: '{server-name}'
69 - docker_merge_boiler_plate: &docker_merge_boiler_plate
70 name: docker_merge_boiler_plate
74 refspec: '$GERRIT_REFSPEC'
75 choosing-strategy: 'default'
76 submodule-recursive: '{submodule-recursive}'
79 - gerrit-trigger-patch-merged:
80 server: '{server-name}'
91 name: '{project-name}-{stream}-merge-docker'
92 # Job template for Docker merge jobs
94 # The purpose of this job template is to run a docker build, and potentially
95 # test validation of the docker image
97 <<: *docker_job_boiler_plate
98 # yamllint disable-line rule:key-duplicates
99 <<: *docker_merge_boiler_plate
102 - lf-infra-docker-login:
103 global-settings-file: 'global-settings'
104 settings-file: '{mvn-settings}'
105 - shell: '{pre_build_script}'
107 # Docker registry is purposely not using an '_' so as to not conflict
108 # with the Jenkins global env var
109 properties-content: |
110 DOCKER_ARGS={docker_build_args}
111 DOCKER_NAME={docker_name}
112 DOCKER_ROOT={docker_root}
113 DOCKER_TAG={docker_tag}
114 DOCKERREGISTRY={docker_registry}
115 # Do the docker build
116 - shell: !include-raw: ../shell/docker-build.sh
118 # Import the docker image information from the build step
119 properties-file: 'env_inject.txt'
120 # Execute any post build clean-up or testing
121 - shell: '{post_build_script}'
122 # Provided all steps have already passed, push the docker image
123 - shell: !include-raw: ../shell/docker-push.sh
126 name: '{project-name}-{stream}-verify-docker'
127 # Job template for Docker verify jobs
129 # The purpose of this job template is to run a docker build, and potentially
130 # test validation of the docker image
132 ######################
133 # Default parameters #
134 ######################
136 <<: *docker_job_boiler_plate
137 # yamllint disable-line rule:key-duplicates
138 <<: *docker_verify_boiler_plate
141 - lf-infra-docker-login:
142 global-settings-file: 'global-settings'
143 settings-file: '{mvn-settings}'
144 - shell: '{pre_build_script}'
146 # Docker registry is purposely not using an '_' so as to not conflict
147 # with the Jenkins global env var
148 properties-content: |
149 DOCKER_ARGS={docker_build_args}
150 DOCKER_NAME={docker_name}
151 DOCKER_ROOT={docker_root}
152 DOCKER_TAG={docker_tag}
153 DOCKERREGISTRY={docker_registry}
154 # Do the docker build
155 - shell: !include-raw: ../shell/docker-build.sh
157 # Import the docker image information from the build step
158 properties-file: 'env_inject.txt'
159 # Execute any post build clean-up or testing
160 - shell: '{post_build_script}'
163 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
164 # Job template for Docker daily release jobs
166 # The purpose of this job template is to run "docker build and docker push"
167 # for projects using this template.
169 # Required Variables:
170 # branch: git branch (eg. stable/lithium or master)
171 <<: *docker_job_boiler_plate
173 docker_registry: '$DOCKER_REGISTRY:10004'
176 - lf-infra-gerrit-scm:
177 jenkins-ssh-credential: '{jenkins-ssh-credential}'
178 git-url: '$GIT_URL/$PROJECT'
179 refspec: '$GERRIT_REFSPEC'
180 branch: '$GERRIT_BRANCH'
181 submodule-recursive: true
182 choosing-strategy: default
185 - lf-infra-docker-login:
186 global-settings-file: 'global-settings'
187 settings-file: '{mvn-settings}'
188 - shell: '{pre_build_script}'
190 # Docker registry is purposely not using an '_' so as to not conflict
191 # with the Jenkins global env var
192 properties-content: |
193 DOCKER_ARGS={docker_build_args}
194 DOCKER_NAME={docker_name}
195 DOCKER_ROOT={docker_root}
196 DOCKER_TAG={docker_tag}
197 DOCKERREGISTRY={docker_registry}
199 # Do the docker build
200 - shell: !include-raw: ../shell/snapshot-strip.sh
201 - shell: !include-raw: ../shell/docker-build.sh
203 # Import the docker image information from the build step
204 properties-file: 'env_inject.txt'
205 # Execute any post build clean-up or testing
206 - shell: '{post_build_script}'
207 # Provided all steps have already passed, push the docker image
208 - shell: !include-raw: ../shell/docker-push.sh
212 - timed: 'H 11 * * *'
213 - gerrit-trigger-release-manually:
214 server: '{server-name}'
219 name: '{project-name}-{subproject}-{stream}-merge-docker'
220 # Job template for Docker merge jobs
222 # The purpose of this job template is to run a docker build, and potentially
223 # test validation of the docker image
225 <<: *docker_job_boiler_plate
226 # yamllint disable-line rule:key-duplicates
227 <<: *docker_merge_boiler_plate
230 - lf-infra-docker-login:
231 global-settings-file: 'global-settings'
232 settings-file: '{mvn-settings}'
233 - shell: '{pre_build_script}'
235 # Docker registry is purposely not using an '_' so as to not conflict
236 # with the Jenkins global env var
237 properties-content: |
238 DOCKER_ARGS={docker_build_args}
239 DOCKER_NAME={docker_name}
240 DOCKER_ROOT={docker_root}
241 DOCKER_TAG={docker_tag}
242 DOCKERREGISTRY={docker_registry}
243 # Do the docker build
244 - shell: !include-raw: ../shell/docker-build.sh
246 # Import the docker image information from the build step
247 properties-file: 'env_inject.txt'
248 # Execute any post build clean-up or testing
249 - shell: '{post_build_script}'
250 # Provided all steps have already passed, push the docker image
251 - shell: !include-raw: ../shell/docker-push.sh
254 name: '{project-name}-{subproject}-{stream}-verify-docker'
255 # Job template for Docker verify jobs
257 # The purpose of this job template is to run a docker build, and potentially
258 # test validation of the docker image
260 ######################
261 # Default parameters #
262 ######################
264 <<: *docker_job_boiler_plate
265 # yamllint disable-line rule:key-duplicates
266 <<: *docker_verify_boiler_plate
269 - lf-infra-docker-login:
270 global-settings-file: 'global-settings'
271 settings-file: '{mvn-settings}'
272 - shell: '{pre_build_script}'
274 # Docker registry is purposely not using an '_' so as to not conflict
275 # with the Jenkins global env var
276 properties-content: |
277 DOCKER_ARGS={docker_build_args}
278 DOCKER_NAME={docker_name}
279 DOCKER_ROOT={docker_root}
280 DOCKER_TAG={docker_tag}
281 DOCKERREGISTRY={docker_registry}
282 # Do the docker build
283 - shell: !include-raw: ../shell/docker-build.sh
285 # Import the docker image information from the build step
286 properties-file: 'env_inject.txt'
287 # Execute any post build clean-up or testing
288 - shell: '{post_build_script}'
291 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
292 # Job template for Docker daily release jobs
294 # The purpose of this job template is to run "docker build and docker push"
295 # for projects using this template.
297 # Required Variables:
298 # branch: git branch (eg. stable/lithium or master)
299 <<: *docker_job_boiler_plate
301 docker_registry: '$DOCKER_REGISTRY:10004'
304 - lf-infra-gerrit-scm:
305 jenkins-ssh-credential: '{jenkins-ssh-credential}'
306 git-url: '$GIT_URL/$PROJECT'
307 refspec: '$GERRIT_REFSPEC'
308 branch: '$GERRIT_BRANCH'
309 submodule-recursive: true
310 choosing-strategy: default
313 - lf-infra-docker-login:
314 global-settings-file: 'global-settings'
315 settings-file: '{mvn-settings}'
316 - shell: '{pre_build_script}'
318 # Docker registry is purposely not using an '_' so as to not conflict
319 # with the Jenkins global env var
320 properties-content: |
321 DOCKER_ARGS={docker_build_args}
322 DOCKER_NAME={docker_name}
323 DOCKER_ROOT={docker_root}
324 DOCKER_TAG={docker_tag}
325 DOCKERREGISTRY={docker_registry}
327 # Do the docker build
328 - shell: !include-raw: ../shell/snapshot-strip.sh
329 - shell: !include-raw: ../shell/docker-build.sh
331 # Import the docker image information from the build step
332 properties-file: 'env_inject.txt'
333 # Execute any post build clean-up or testing
334 - shell: '{post_build_script}'
335 # Provided all steps have already passed, push the docker image
336 - shell: !include-raw: ../shell/docker-push.sh
340 - timed: 'H 11 * * *'
341 - gerrit-trigger-release-manually:
342 server: '{server-name}'