atlantis
atlantis copied to clipboard
multienv output suppression breaks settings env vars
Overview of the Issue
https://github.com/runatlantis/atlantis/issues/4388 added the possibility to suppress the "Dynamic environment variables added:" output of multienv but it doesn't seem to be working as expected.
Reproduction Steps
# /data/dev.env
FOO="fuzz"
workflows:
dev:
plan:
steps:
- multienv:
command: multienv /data/dev.env
output: show
- init
- run: echo "${FOO}"
Correctly returns fuzz in the comment whereas the following doesn't:
- multienv:
command: multienv /data/dev.env
output: hide
Additional Context
As far as I can tell the problem originates from here where postProcessOutput is passed to the runner which proceeds to discard the output here by returning "" when postProcessOutput is set to PostProcessRunOutputHide. This causes the caller not to receive any key=value to process and export.
I have the same issue. Atlantis version is v0.28.5
confirming on 0.32 as well
This is still an issue for version 0.33, so we can't utilize it. Do you maybe have any plans to fix this?
I honestly gave up. I wrote a script that pulls all of the info that I need to build my environment variables and put that into a json format. Then I just go through that using jq to pull out individual vars. It's stupid but it works.
e.g.
# Set env variables for provider configs
- env:
name: VAULT_JSON
command: gather_vault_secrets.sh
- env:
name: DD_API_KEY
command: 'echo $VAULT_JSON | jq -r .DD_API_KEY'
- env:
name: DD_APP_KEY
command: 'echo $VAULT_JSON | jq -r .DD_APP_KEY'