How to get the values from global environment variables into environment build config

Good afternoon. I ask for help because i have been trying different ways to get the values from environment vars in the global config of the project to the environment into a build. These are the configs that i’ve been trying:

environment:
  - FAST_PURGE: "${FAST_PURGE_STG}"
  - AKAMAI_BASE_URL: "${AKAMAI_BASE_URL_STG}"
  - AKAMAI_CLIENT_SECRET: "${AKAMAI_CLIENT_SECRET_STG}"
  - AKAMAI_ACCESS_TOKEN: "${AKAMAI_ACCESS_TOKEN_STG}"
  - AKAMAI_CLIENT_TOKEN: "${AKAMAI_CLIENT_TOKEN_STG}"

environment:
  - FAST_PURGE: "$FAST_PURGE_STG"
  - AKAMAI_BASE_URL: "$AKAMAI_BASE_URL_STG"
  - AKAMAI_CLIENT_SECRET: "$AKAMAI_CLIENT_SECRET_STG"
  - AKAMAI_ACCESS_TOKEN: "$AKAMAI_ACCESS_TOKEN_STG"
  - AKAMAI_CLIENT_TOKEN: "$AKAMAI_CLIENT_TOKEN_STG"

environment:
  - FAST_PURGE: $FAST_PURGE_STG
  - AKAMAI_BASE_URL: $AKAMAI_BASE_URL_STG
  - AKAMAI_CLIENT_SECRET: $AKAMAI_CLIENT_SECRET_STG
  - AKAMAI_ACCESS_TOKEN: $AKAMAI_ACCESS_TOKEN_STG
  - AKAMAI_CLIENT_TOKEN: $AKAMAI_CLIENT_TOKEN_STG

In all the cases i’ve got it as a value the name of the variable that i’m trying to obtain his value, for example for FAST_PURGE variable i’ve got it ${FAST_PURGE_STG}, $FAST_PURGE_STG and $FAST_PURGE_STG for the three past cases.

Thanks in advance for your help.

2 Likes

Is there any answer for this??? I am experiencing the same issue. The documentation is useless and I have tried the above ways too.

Would CircleCI please provide the syntax for environment variables!!!

Pro-tip: this won’t encourage people to help you. Remember that one person’s plain-speaking is another person’s insult - especially on the internet! - and modify your language accordingly.

:smiley_cat:

@GustavoAdolfoRamirez did you find a solution for this?

Hi @bradleyayers, the solution that i’ve used was declare the environment variables for the job inside the “command” declaration like:

export FAST_PURGE=$FAST_PURGE_STG
export AKAMAI_BASE_URL=$AKAMAI_BASE_URL_STG
export AKAMAI_CLIENT_SECRET=$AKAMAI_CLIENT_SECRET_STG
export AKAMAI_ACCESS_TOKEN=$AKAMAI_ACCESS_TOKEN_STG
export AKAMAI_CLIENT_TOKEN=$AKAMAI_CLIENT_TOKEN_STG

I hope that this can help anyone.

Greetings.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.