Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to pass BUILD_ARG_* from inputs? #75

Open
samed opened this issue Nov 2, 2021 · 1 comment
Open

Possibility to pass BUILD_ARG_* from inputs? #75

samed opened this issue Nov 2, 2021 · 1 comment

Comments

@samed
Copy link

samed commented Nov 2, 2021

Hello,

Currently, I'm using BUILD_ARGS_FILE and populating args within another task and passing the output file to the oci-build-task as input. I'm just curious if there's the possibility to pass BUILD_ARG_* from inputs directly (eg. BUILD_ARG_APP_VERSION: git-repo/.git/short_ref )

@suhlig
Copy link

suhlig commented Apr 5, 2022

I am using load_var for this purpose.

See this example from my task library:

- load_var: ginkgo-version
  file: ginkgo-release/version
- task: build-image
  file: lib/tasks/oci/build-image.yml
  params:
    BUILD_ARG_VERSION: v((.:ginkgo-version))
  • ginkgo-release is a github-release resource, tracking onsi/ginkgo. It writes the fetched release version to ginkgo-release/version
  • This file is then loaded as variable ginkgo-version and used in the BUILD_ARG_VERSION parameter (with an additional v).
  • Finally, the Dockerfile uses the build arg VERSION to determine which version of ginkgo to install.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants