Skip to content

Commit b0f6d52

Browse files
authored
Merge pull request #31 from CoverGo/ci/CVHL-4036-pass-build-args-to-service-image-build-command
ci: Pass version info in build_args to service image
2 parents f455a21 + f86b9d9 commit b0f6d52

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.gflows/libs/job_docker_build.lib.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
- #@ steps.echo_docker_digest(step_id_value, component)
2525
#@ end
2626
---
27-
#@ def _image_build_job(component, sections, needs=["version"], tag_build=None, job_name=None, push=True, environment_variables=None):
28-
#@ stepsYaml = _image_build_job_steps(component, sections.cache_registry, tag_build, job_name, push)
27+
#@ def _image_build_job(component, sections, needs=["version"], tag_build=None, job_name=None, push=True, environment_variables=None, build_versioned_image=False):
28+
#@ stepsYaml = _image_build_job_steps(component, sections.cache_registry, tag_build, job_name, push, build_versioned_image)
2929
#@ job_name = common.get_value(job_name,job.name.docker_build(component))
3030
#@ outputs = steps.define_docker_outputs(component)
3131
#@ return common.generate_job(component, stepsYaml, environment_variables, sections, needs, job_name, outputs=outputs)

.gflows/workflows/build-publish/build-publish.template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
#@ for service_section in service_sections:
5353
#@ service_image_build_tag = tagging.candidate_image(data.values.cache_registry, service_section)
54-
#@ jobs[job.id.docker_build(service_section)] = docker.job.build(service_section, data.values, ["version"], service_image_build_tag)
54+
#@ jobs[job.id.docker_build(service_section)] = docker.job.build(service_section, data.values, ["version"], service_image_build_tag, build_versioned_image=True )
5555
#@ end
5656

5757
#@ for unit_test_section in getattr(data.values,"unit_test",[]):

github-sample/workflows/build-publish.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# File generated by gflows, do not modify
2-
# Source: .gflows\workflows\build-publish
2+
# Source: .gflows/workflows/build-publish
33
name: Build and publish
44
"on":
55
push:
@@ -263,7 +263,11 @@ jobs:
263263
cache-from: type=registry,ref=ghcr.io/covergo/auth-cache:${{ needs.version.outputs.issue_id_slug }}
264264
cache-to: type=registry,ref=ghcr.io/covergo/auth-cache:${{ needs.version.outputs.issue_id_slug }},mode=max
265265
target: build-service
266-
build-args: COMMIT_SHA=${{ github.sha }}
266+
build-args: |-
267+
COMMIT_SHA=${{ github.sha }}
268+
APP_VERSION=${{ needs.version.outputs.app_version }}
269+
FILE_VERSION=${{ needs.version.outputs.file_version }}
270+
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
267271
- name: Image digest
268272
env:
269273
docker_digest: ${{ steps.docker-build-auth-service.outputs.digest }}
@@ -307,7 +311,11 @@ jobs:
307311
type=registry,ref=ghcr.io/covergo/auth-predeployment-cache:${{ needs.version.outputs.issue_id_slug }}
308312
cache-to: type=registry,ref=ghcr.io/covergo/auth-predeployment-cache:${{ needs.version.outputs.issue_id_slug }},mode=max
309313
target: build-predeployment
310-
build-args: COMMIT_SHA=${{ github.sha }}
314+
build-args: |-
315+
COMMIT_SHA=${{ github.sha }}
316+
APP_VERSION=${{ needs.version.outputs.app_version }}
317+
FILE_VERSION=${{ needs.version.outputs.file_version }}
318+
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
311319
- name: Image digest
312320
env:
313321
docker_digest: ${{ steps.docker-build-auth-predeployment.outputs.digest }}

0 commit comments

Comments
 (0)