Last active
November 18, 2024 10:41
-
-
Save viktorbenei/89fba333e58ba34483cb to your computer and use it in GitHub Desktop.
[DEPRECATED - SEE COMMENT] Bitrise: save environment to .bash_profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# To export an environment for other steps in your workflow you have to add the environment variable to | |
# a persistent environment store. Every step runs in it's own shell session and so if | |
# a previous step just exports an environment it won't be available for other steps, | |
# unless you add it to a persistent store (like .bash_profile) | |
# | |
# | |
# you can save an environment to .bash_profile in a bash script like this: | |
echo 'export MYTESTENV="my test value"' >> ~/.bash_profile | |
# | |
# then in the subsequent steps you can get and use it like this: | |
# echo "MYTESTENV: ${MYTESTENV}" | |
# | |
# | |
# if you want to use the variable in the same step too then you have to export it the regular way: | |
export MYTESTENV="my test value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DON'T USE THIS ANYMORE. The current recommended way to exposing environment variables is via
envman
(https://github.com/bitrise-io/envman)Guide: https://devcenter.bitrise.io/en/builds/environment-variables.html#setting-and-managing-env-vars-during-a-build