I’m trying to interpolate an environment variable within another one as it’s stated in the project configuration UI (Environment variables section).
No matter which variable I use (even the example: ${HOME}) it’s always escaped (\$HOME). I’m using export as a build step to print all the environment variables and debug it.
Righto, so you’re trying to set API_URL equal to another variable. I don’t know if that works from the dialogue box, but the help text says it should!
If I were debugging this, I would try these:
Swap ${CIRCLE_BRANCH} in that dialogue box for a non-variable value. Does that work? If it does, then maybe this dialogue only works for things that exist forever (e.g. $HOME) and the one you are trying to use is created too late to be interpolated correctly?
Consider deleting this var and adding API_URL=${CIRCLE_BRANCH} in an early run step in your config file instead.
If that does not work, try putting export in front of it. I am not an expert on env var behaviour, but I believe this can make a difference when wanting env vars to be exposed to new processes.
Great stuff! I believe you can mark your answer above as the solution by clicking the ‘solved’ widget just below it - that may be useful for a future reader.