Reference an environment variable in "environment" yaml map?


Is it possible to use an env var in the “environment” section of our config?


  TEST: ${TEST2}

I’m basically trying to get a env var that is set via web UI to be locally scoped to a specific step.

Environment variables aren't rendering

Not yet but I won’t personally consider 2.0 a full product until that’s implemented :slight_smile:


Hi Billy,

@rohara mentioned workarounds in another post:

In each step, you need to use $(eval echo ${TEST}) instead of ${TEST}. That’s it.


If you’re using bash, you can do something like this:

    - BASH_ENV: envrc
    - run:
        echo '
        export TEST=$TEST2
        export PATH=$HOME/bin:$PATH
        ' >> envrc

Any subsequent steps that use bash will automatically source the envrc file.


I just wanted to note we haven’t forgotten about this - it’s still on our roadmap. :slight_smile:


+1 really need this


Just hit this one, any updates?


Huge +1 from me


Can I just triple check I understand the fundamentals of how CircleCI 2.0 should work, and it might help me to understand how and where I can use environment variables.

So, you create a base docker image with all your build dependencies, right? And you define environment variables in your… build step? Are those variables then present within your docker image when you run your build? When you run your build, is the build context completely within that container? Or are you in a VM, which runs your container? Apologies if this is the wrong place to ask, but I’m struggling to get my builds working since upgrading to version 2.0, and it’s mostly down to missing env vars currently!

Any pointers, massive appreciated :slight_smile:




Ping, just to make sure is in the priorities for 2018 :slight_smile:


We haven’t forgotten but I definitely wouldn’t hold my breath :frowning:


So 2.0 still isn’t a full product yet?
ducks and runs away…


Cast your vote for this issue in the new “Feature Requests”/Ideas portal


Any update on this? Tried DominickGM’s solution as well but it didn’t work.


Now that we’re being forced to 2.0 in August this year, can we get an update on this?


Yeah, let’s get an update!


+1 here, the workaround isn’t ideal and commands should be able to execute a variable in ${VAR} format like in shell