envman
envman copied to clipboard
Env Vars set using envman are not available in current step
In a single script step do the following
envman add --key SOME_KEY --value 'some value'
echo $SOME_KEY
Note that the Env Var is not set
Ideally Envman would also set the env var using export
so it is available in the current step
export SOME_KEY="some value"
Facing this problem as well.
Hi, thank you for contacting Bitrise. This is the expected behavior and here's the response from our engineer.
Envman is a file-based env store tool. When you add an env var it writes to a file. When you execute a command with envman (like Bitrise steps) envman reads this file and passes it to the standard go execution package. So technically it does not know anything about how to set these or what an env var is.
You can check the Usage example: Simple Bash example in the Readme.md file for further explanation.
Is there a command that can be run to load the new Env Vars into the current shell maybe?
Hi @DamienBitrise , adding the env to the current shell session and adding it to the envstore file when envman add
is executed is a valid feature request, even if the current behavior is by design.
Is there a command that can be run to load the new Env Vars into the current shell maybe?
Unfortunetly there isn't a single command you could use.
envman print
prints the content of the envstore file in the format:
KEY_1: VALUE_1
KEY_2: VALUE_2
...
, or in a json format --format json
.
i've overcome this problem long time ago by using:
export FOO="BAR"