From @viktorbenei on Tue Nov 10 2015 09:51:32 GMT-0500 (EST) Assign the value of one env to another one (Step outputs are just regular Environment Variables)
Ex: if different tools use different envs for the same thing, like ipa path
Something simple like:
#!/bin/bash
set -e
source_env_value="${!source_env_key}"
echo "source_env_key: $source_env_key"
echo "source_env_value: $source_env_value"
echo "=> Mapping $source_env_key to $target_env_key"
set -x
echo -n "$source_env_value" | envman add --key "$target_env_key"
Copied from original issue: [Step] "bridge" an environment variable - assign the value of one Step's output to another Environment Variable · Issue #2 · bitrise-io/bitrise-contrib · GitHub
@viktorbenei Do you think this feature request was covered by the addition of “step output aliases” in Monthly release of Bitrise CLI tools and summary of updates (May, 2017) - CLI v1.6.1 ?
1 Like
It’s mostly covered with that feature indeed, but there might still be a use case for this step, e.g. to “broadcast” env vars. With the output alias you can only specify one alias for that env var, with this step you could copy the value into as many env vars as you like.
Whether that’s useful at all is a different question, but I guess this step can be a good/simple way for someone new to Bitrise CLI/Step dev to get started
Update: output aliases are now available in the Bitrise CLI (for a while):
We ship a new bitrise cli version on the second Tuesday of every month.
The new release will be available on the bitrise.io
virtual machines on the weekend after the CLI release,
unless we discover any serious bug / regression.
Read on to learn more about this month’s Bitrise CLI release and about the changes around bitrise tools and steps.
New version of Bitrise CLI (1.6.1 )
1. Install local plugins:
From this bitrise-cli version you can test your local plugin directly through the CLI, …
Set environment variable step is now available, thanks to @kdobmayer
We released a new version (0.9.1 ) of Set environment variable step.
Changes:
Fix typo in title
This should now cover all remaining use case for this Feature Requests so closing it