Skip to content

Commit

Permalink
Merge pull request #31 from CoverGo/ci/CVHL-4036-pass-build-args-to-s…
Browse files Browse the repository at this point in the history
…ervice-image-build-command

ci:  Pass version info in build_args to service image
  • Loading branch information
NazmiAltun authored Nov 30, 2022
2 parents f455a21 + f86b9d9 commit b0f6d52
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gflows/libs/job_docker_build.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- #@ steps.echo_docker_digest(step_id_value, component)
#@ end
---
#@ def _image_build_job(component, sections, needs=["version"], tag_build=None, job_name=None, push=True, environment_variables=None):
#@ stepsYaml = _image_build_job_steps(component, sections.cache_registry, tag_build, job_name, push)
#@ def _image_build_job(component, sections, needs=["version"], tag_build=None, job_name=None, push=True, environment_variables=None, build_versioned_image=False):
#@ stepsYaml = _image_build_job_steps(component, sections.cache_registry, tag_build, job_name, push, build_versioned_image)
#@ job_name = common.get_value(job_name,job.name.docker_build(component))
#@ outputs = steps.define_docker_outputs(component)
#@ return common.generate_job(component, stepsYaml, environment_variables, sections, needs, job_name, outputs=outputs)
Expand Down
2 changes: 1 addition & 1 deletion .gflows/workflows/build-publish/build-publish.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

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

#@ for unit_test_section in getattr(data.values,"unit_test",[]):
Expand Down
14 changes: 11 additions & 3 deletions github-sample/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# File generated by gflows, do not modify
# Source: .gflows\workflows\build-publish
# Source: .gflows/workflows/build-publish
name: Build and publish
"on":
push:
Expand Down Expand Up @@ -263,7 +263,11 @@ jobs:
cache-from: type=registry,ref=ghcr.io/covergo/auth-cache:${{ needs.version.outputs.issue_id_slug }}
cache-to: type=registry,ref=ghcr.io/covergo/auth-cache:${{ needs.version.outputs.issue_id_slug }},mode=max
target: build-service
build-args: COMMIT_SHA=${{ github.sha }}
build-args: |-
COMMIT_SHA=${{ github.sha }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
- name: Image digest
env:
docker_digest: ${{ steps.docker-build-auth-service.outputs.digest }}
Expand Down Expand Up @@ -307,7 +311,11 @@ jobs:
type=registry,ref=ghcr.io/covergo/auth-predeployment-cache:${{ needs.version.outputs.issue_id_slug }}
cache-to: type=registry,ref=ghcr.io/covergo/auth-predeployment-cache:${{ needs.version.outputs.issue_id_slug }},mode=max
target: build-predeployment
build-args: COMMIT_SHA=${{ github.sha }}
build-args: |-
COMMIT_SHA=${{ github.sha }}
APP_VERSION=${{ needs.version.outputs.app_version }}
FILE_VERSION=${{ needs.version.outputs.file_version }}
INFORMATIONAL_VERSION=${{ needs.version.outputs.information_version }}
- name: Image digest
env:
docker_digest: ${{ steps.docker-build-auth-predeployment.outputs.digest }}
Expand Down

0 comments on commit b0f6d52

Please sign in to comment.