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}'
70 - docker_merge_boiler_plate: &docker_merge_boiler_plate
71 name: docker_merge_boiler_plate
75 refspec: '$GERRIT_REFSPEC'
76 choosing-strategy: 'default'
77 submodule-recursive: '{submodule-recursive}'
80 - gerrit-trigger-patch-merged:
81 server: '{server-name}'
92 name: '{project-name}-{stream}-merge-docker'
93 # Job template for Docker merge jobs
95 # The purpose of this job template is to run a docker build, and potentially
96 # test validation of the docker image
98 <<: *docker_job_boiler_plate
99 # yamllint disable-line rule:key-duplicates
100 <<: *docker_merge_boiler_plate
103 - lf-infra-docker-login:
104 global-settings-file: 'global-settings'
105 settings-file: '{mvn-settings}'
106 - shell: '{pre_build_script}'
108 # Docker registry is purposely not using an '_' so as to not conflict
109 # with the Jenkins global env var
110 properties-content: |
111 DOCKER_ARGS={docker_build_args}
112 DOCKER_NAME={docker_name}
113 DOCKER_ROOT={docker_root}
114 DOCKER_TAG={docker_tag}
115 DOCKERREGISTRY={docker_registry}
116 # Do the docker build
117 - shell: !include-raw: ../shell/docker-build.sh
119 # Import the docker image information from the build step
120 properties-file: 'env_inject.txt'
121 # Execute any post build clean-up or testing
122 - shell: '{post_build_script}'
123 # Provided all steps have already passed, push the docker image
124 - shell: !include-raw: ../shell/docker-push.sh
127 name: '{project-name}-{stream}-verify-docker'
128 # Job template for Docker verify jobs
130 # The purpose of this job template is to run a docker build, and potentially
131 # test validation of the docker image
133 ######################
134 # Default parameters #
135 ######################
137 <<: *docker_job_boiler_plate
138 # yamllint disable-line rule:key-duplicates
139 <<: *docker_verify_boiler_plate
142 - lf-infra-docker-login:
143 global-settings-file: 'global-settings'
144 settings-file: '{mvn-settings}'
145 - shell: '{pre_build_script}'
147 # Docker registry is purposely not using an '_' so as to not conflict
148 # with the Jenkins global env var
149 properties-content: |
150 DOCKER_ARGS={docker_build_args}
151 DOCKER_NAME={docker_name}
152 DOCKER_ROOT={docker_root}
153 DOCKER_TAG={docker_tag}
154 DOCKERREGISTRY={docker_registry}
155 # Do the docker build
156 - shell: !include-raw: ../shell/docker-build.sh
158 # Import the docker image information from the build step
159 properties-file: 'env_inject.txt'
160 # Execute any post build clean-up or testing
161 - shell: '{post_build_script}'
164 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
165 # Job template for Docker daily release jobs
167 # The purpose of this job template is to run "docker build and docker push"
168 # for projects using this template.
170 # Required Variables:
171 # branch: git branch (eg. stable/lithium or master)
172 <<: *docker_job_boiler_plate
174 docker_registry: '$DOCKER_REGISTRY:10004'
177 - lf-infra-gerrit-scm:
178 jenkins-ssh-credential: '{jenkins-ssh-credential}'
179 git-url: '$GIT_URL/$PROJECT'
180 refspec: '$GERRIT_REFSPEC'
181 branch: '$GERRIT_BRANCH'
182 submodule-recursive: true
183 choosing-strategy: default
186 - lf-infra-docker-login:
187 global-settings-file: 'global-settings'
188 settings-file: '{mvn-settings}'
189 - shell: '{pre_build_script}'
191 # Docker registry is purposely not using an '_' so as to not conflict
192 # with the Jenkins global env var
193 properties-content: |
194 DOCKER_ARGS={docker_build_args}
195 DOCKER_NAME={docker_name}
196 DOCKER_ROOT={docker_root}
197 DOCKER_TAG={docker_tag}
198 DOCKERREGISTRY={docker_registry}
200 # Do the docker build
201 - shell: !include-raw: ../shell/snapshot-strip.sh
202 - shell: !include-raw: ../shell/docker-build.sh
204 # Import the docker image information from the build step
205 properties-file: 'env_inject.txt'
206 # Execute any post build clean-up or testing
207 - shell: '{post_build_script}'
208 # Provided all steps have already passed, push the docker image
209 - shell: !include-raw: ../shell/docker-push.sh
213 - timed: 'H 11 * * *'
214 - gerrit-trigger-release-manually:
215 server: '{server-name}'
220 name: '{project-name}-{subproject}-{stream}-merge-docker'
221 # Job template for Docker merge jobs
223 # The purpose of this job template is to run a docker build, and potentially
224 # test validation of the docker image
226 <<: *docker_job_boiler_plate
227 # yamllint disable-line rule:key-duplicates
228 <<: *docker_merge_boiler_plate
231 - lf-infra-docker-login:
232 global-settings-file: 'global-settings'
233 settings-file: '{mvn-settings}'
234 - shell: '{pre_build_script}'
236 # Docker registry is purposely not using an '_' so as to not conflict
237 # with the Jenkins global env var
238 properties-content: |
239 DOCKER_ARGS={docker_build_args}
240 DOCKER_NAME={docker_name}
241 DOCKER_ROOT={docker_root}
242 DOCKER_TAG={docker_tag}
243 DOCKERREGISTRY={docker_registry}
244 # Do the docker build
245 - shell: !include-raw: ../shell/docker-build.sh
247 # Import the docker image information from the build step
248 properties-file: 'env_inject.txt'
249 # Execute any post build clean-up or testing
250 - shell: '{post_build_script}'
251 # Provided all steps have already passed, push the docker image
252 - shell: !include-raw: ../shell/docker-push.sh
255 name: '{project-name}-{subproject}-{stream}-verify-docker'
256 # Job template for Docker verify jobs
258 # The purpose of this job template is to run a docker build, and potentially
259 # test validation of the docker image
261 ######################
262 # Default parameters #
263 ######################
265 <<: *docker_job_boiler_plate
266 # yamllint disable-line rule:key-duplicates
267 <<: *docker_verify_boiler_plate
270 - lf-infra-docker-login:
271 global-settings-file: 'global-settings'
272 settings-file: '{mvn-settings}'
273 - shell: '{pre_build_script}'
275 # Docker registry is purposely not using an '_' so as to not conflict
276 # with the Jenkins global env var
277 properties-content: |
278 DOCKER_ARGS={docker_build_args}
279 DOCKER_NAME={docker_name}
280 DOCKER_ROOT={docker_root}
281 DOCKER_TAG={docker_tag}
282 DOCKERREGISTRY={docker_registry}
283 # Do the docker build
284 - shell: !include-raw: ../shell/docker-build.sh
286 # Import the docker image information from the build step
287 properties-file: 'env_inject.txt'
288 # Execute any post build clean-up or testing
289 - shell: '{post_build_script}'
292 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
293 # Job template for Docker daily release jobs
295 # The purpose of this job template is to run "docker build and docker push"
296 # for projects using this template.
298 # Required Variables:
299 # branch: git branch (eg. stable/lithium or master)
300 <<: *docker_job_boiler_plate
302 docker_registry: '$DOCKER_REGISTRY:10004'
305 - lf-infra-gerrit-scm:
306 jenkins-ssh-credential: '{jenkins-ssh-credential}'
307 git-url: '$GIT_URL/$PROJECT'
308 refspec: '$GERRIT_REFSPEC'
309 branch: '$GERRIT_BRANCH'
310 submodule-recursive: true
311 choosing-strategy: default
314 - lf-infra-docker-login:
315 global-settings-file: 'global-settings'
316 settings-file: '{mvn-settings}'
317 - shell: '{pre_build_script}'
319 # Docker registry is purposely not using an '_' so as to not conflict
320 # with the Jenkins global env var
321 properties-content: |
322 DOCKER_ARGS={docker_build_args}
323 DOCKER_NAME={docker_name}
324 DOCKER_ROOT={docker_root}
325 DOCKER_TAG={docker_tag}
326 DOCKERREGISTRY={docker_registry}
328 # Do the docker build
329 - shell: !include-raw: ../shell/snapshot-strip.sh
330 - shell: !include-raw: ../shell/docker-build.sh
332 # Import the docker image information from the build step
333 properties-file: 'env_inject.txt'
334 # Execute any post build clean-up or testing
335 - shell: '{post_build_script}'
336 # Provided all steps have already passed, push the docker image
337 - shell: !include-raw: ../shell/docker-push.sh
341 - timed: 'H 11 * * *'
342 - gerrit-trigger-release-manually:
343 server: '{server-name}'