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

Allow custom environment variables #172

Open
brennanwilkes opened this issue Jun 9, 2022 · 2 comments
Open

Allow custom environment variables #172

brennanwilkes opened this issue Jun 9, 2022 · 2 comments

Comments

@brennanwilkes
Copy link

It would be helpful to allow environment variables to be passed to docker's build context, so that deployment time logic (like versions, tags, etc) can be baked into the final image

@thgreasi
Copy link
Member

Hi,
This sounds useful.
You should be able to workaround this by adding an extra step to your workflow which creates a .balena/balena.yml file inside the project's directory and defining the build time env vars/secrets there.

- name: decode build time secrets
  shell: bash
  run: |
    set -ax

    mkdir -p ".balena"

    echo "${{ secrets.BUILD_TIME_SECRET_ENV_VARS }}" \
      | base64 -d > ".balena/balena.yml"

The base64 decoded .balena/balena.yml file should look like the one described in our docs:
https://www.balena.io/docs/learn/deploy/deployment/#build-variables

@jellyfish-bot
Copy link

[thgreasi] This has attached https://jel.ly.fish/c50c50aa-06a3-43d2-8ade-75a8f7ba127b

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

3 participants