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}
116 DOCKERREGISTRY={docker_registry}
117 # Do the docker build
118 - shell: !include-raw: ../shell/docker-build.sh
120 # Import the docker image information from the build step
121 properties-file: 'env_inject.txt'
122 # Execute any post build clean-up or testing
123 - shell: '{post_build_script}'
124 # Provided all steps have already passed, push the docker image
125 - shell: !include-raw: ../shell/docker-push.sh
128 name: '{project-name}-{stream}-verify-docker'
129 # Job template for Docker verify jobs
131 # The purpose of this job template is to run a docker build, and potentially
132 # test validation of the docker image
134 ######################
135 # Default parameters #
136 ######################
138 <<: *docker_job_boiler_plate
139 # yamllint disable-line rule:key-duplicates
140 <<: *docker_verify_boiler_plate
143 - lf-infra-docker-login:
144 global-settings-file: 'global-settings'
145 settings-file: '{mvn-settings}'
146 - shell: '{pre_build_script}'
148 # Docker registry is purposely not using an '_' so as to not conflict
149 # with the Jenkins global env var
150 properties-content: |
151 DOCKER_ARGS={docker_build_args}
152 DOCKER_NAME={docker_name}
153 DOCKER_ROOT={docker_root}
154 DOCKER_TAG={docker_tag}
156 DOCKERREGISTRY={docker_registry}
157 # Do the docker build
158 - shell: !include-raw: ../shell/docker-build.sh
160 # Import the docker image information from the build step
161 properties-file: 'env_inject.txt'
162 # Execute any post build clean-up or testing
163 - shell: '{post_build_script}'
166 name: '{project-name}-{stream}-release-version-docker-daily-no-sonar'
167 # Job template for Docker daily release jobs
169 # The purpose of this job template is to run "docker build and docker push"
170 # for projects using this template.
172 # Required Variables:
173 # branch: git branch (eg. stable/lithium or master)
174 <<: *docker_job_boiler_plate
176 docker_registry: '$DOCKER_REGISTRY:10003'
179 - lf-infra-gerrit-scm:
180 jenkins-ssh-credential: '{jenkins-ssh-credential}'
181 git-url: '$GIT_URL/$PROJECT'
182 refspec: '$GERRIT_REFSPEC'
183 branch: '$GERRIT_BRANCH'
184 submodule-recursive: true
185 choosing-strategy: default
188 - lf-infra-docker-login:
189 global-settings-file: 'global-settings'
190 settings-file: '{mvn-settings}'
191 - shell: '{pre_build_script}'
193 # Docker registry is purposely not using an '_' so as to not conflict
194 # with the Jenkins global env var
195 properties-content: |
196 DOCKER_ARGS={docker_build_args}
197 DOCKER_NAME={docker_name}
198 DOCKER_ROOT={docker_root}
199 DOCKER_TAG={docker_tag}
200 DOCKERREGISTRY={docker_registry}
203 # Do the docker build
204 - shell: !include-raw: ../shell/snapshot-strip.sh
205 - shell: !include-raw: ../shell/docker-build.sh
207 # Import the docker image information from the build step
208 properties-file: 'env_inject.txt'
209 # Execute any post build clean-up or testing
210 - shell: '{post_build_script}'
211 # Provided all steps have already passed, push the docker image
212 - shell: !include-raw: ../shell/docker-push.sh
216 - timed: 'H 11 * * *'
217 - gerrit-trigger-release-manually:
218 server: '{server-name}'
223 name: '{project-name}-{subproject}-{stream}-merge-docker'
224 # Job template for Docker merge jobs
226 # The purpose of this job template is to run a docker build, and potentially
227 # test validation of the docker image
229 <<: *docker_job_boiler_plate
230 # yamllint disable-line rule:key-duplicates
231 <<: *docker_merge_boiler_plate
234 - lf-infra-docker-login:
235 global-settings-file: 'global-settings'
236 settings-file: '{mvn-settings}'
237 - shell: '{pre_build_script}'
239 # Docker registry is purposely not using an '_' so as to not conflict
240 # with the Jenkins global env var
241 properties-content: |
242 DOCKER_ARGS={docker_build_args}
243 DOCKER_NAME={docker_name}
244 DOCKER_ROOT={docker_root}
245 DOCKER_TAG={docker_tag}
246 DOCKERREGISTRY={docker_registry}
248 # Do the docker build
249 - shell: !include-raw: ../shell/docker-build.sh
251 # Import the docker image information from the build step
252 properties-file: 'env_inject.txt'
253 # Execute any post build clean-up or testing
254 - shell: '{post_build_script}'
255 # Provided all steps have already passed, push the docker image
256 - shell: !include-raw: ../shell/docker-push.sh
259 name: '{project-name}-{subproject}-{stream}-verify-docker'
260 # Job template for Docker verify jobs
262 # The purpose of this job template is to run a docker build, and potentially
263 # test validation of the docker image
265 ######################
266 # Default parameters #
267 ######################
269 <<: *docker_job_boiler_plate
270 # yamllint disable-line rule:key-duplicates
271 <<: *docker_verify_boiler_plate
274 - lf-infra-docker-login:
275 global-settings-file: 'global-settings'
276 settings-file: '{mvn-settings}'
277 - shell: '{pre_build_script}'
279 # Docker registry is purposely not using an '_' so as to not conflict
280 # with the Jenkins global env var
281 properties-content: |
282 DOCKER_ARGS={docker_build_args}
283 DOCKER_NAME={docker_name}
284 DOCKER_ROOT={docker_root}
285 DOCKER_TAG={docker_tag}
286 DOCKERREGISTRY={docker_registry}
288 # Do the docker build
289 - shell: !include-raw: ../shell/docker-build.sh
291 # Import the docker image information from the build step
292 properties-file: 'env_inject.txt'
293 # Execute any post build clean-up or testing
294 - shell: '{post_build_script}'
297 name: '{project-name}-{subproject}-{stream}-release-version-docker-daily-no-sonar'
298 # Job template for Docker daily release jobs
300 # The purpose of this job template is to run "docker build and docker push"
301 # for projects using this template.
303 # Required Variables:
304 # branch: git branch (eg. stable/lithium or master)
305 <<: *docker_job_boiler_plate
307 docker_registry: '$DOCKER_REGISTRY:10003'
310 - lf-infra-gerrit-scm:
311 jenkins-ssh-credential: '{jenkins-ssh-credential}'
312 git-url: '$GIT_URL/$PROJECT'
313 refspec: '$GERRIT_REFSPEC'
314 branch: '$GERRIT_BRANCH'
315 submodule-recursive: true
316 choosing-strategy: default
319 - lf-infra-docker-login:
320 global-settings-file: 'global-settings'
321 settings-file: '{mvn-settings}'
322 - shell: '{pre_build_script}'
324 # Docker registry is purposely not using an '_' so as to not conflict
325 # with the Jenkins global env var
326 properties-content: |
327 DOCKER_ARGS={docker_build_args}
328 DOCKER_NAME={docker_name}
329 DOCKER_ROOT={docker_root}
330 DOCKER_TAG={docker_tag}
331 DOCKERREGISTRY={docker_registry}
334 # Do the docker build
335 - shell: !include-raw: ../shell/snapshot-strip.sh
336 - shell: !include-raw: ../shell/docker-build.sh
338 # Import the docker image information from the build step
339 properties-file: 'env_inject.txt'
340 # Execute any post build clean-up or testing
341 - shell: '{post_build_script}'
342 # Provided all steps have already passed, push the docker image
343 - shell: !include-raw: ../shell/docker-push.sh
347 - timed: 'H 11 * * *'
348 - gerrit-trigger-release-manually:
349 server: '{server-name}'