Envars behavior - v1 versus v2

envars

#1

I expected echo $APP_NAME -> mygithubreponame
but I got:

version: 2
  jobs:
    build:
      machine: true
    environment:
      APP_NAME: $CIRCLE_PROJECT_REPONAME
    steps:
      - run: echo $CIRCLE_PROJECT_REPONAME -> 'mygithubreponame'
      - run: echo $APP_NAME                -> '$CIRCLE_PROJECT_REPONAME'

This works in v1

(some stuff)
  environment:
    APP_NAME: $CIRCLE_PROJECT_REPONAME

test:
  override:
    - echo $CIRCLE_PROJECT_REPONAME ->'mygithubreponame'
    - echo $APP_NAME                ->'mygithubreponame'
  • How can I do the same in v2?

#2

Can you use echo $(eval echo ${APP_NAME})

OR

echo 'export APP_NAME=$CIRCLE_PROJECT_REPONAME' > ~/.env and define BASH_ENV: ~/.env in your environment variables.


#3

I wasn’t clear enough in my question. I understand I can do a workaround, just wanted the same clean ux as v1. The behavior of v2 is unexpected.


#4

Then this is superseded by open feature requests. I will close this specific thread.


#5