Environment variable expansion


#1

In Circle 2.0, it seems like environment variables are not expanded in environment: blocks. At least seems to be the case when I set environment variables on job-level and on specific run commands.

jobs:
   build:
       environment:
         FOO: ${HOME}/foo.txt

This will not expand ${HOME} as is expected.

Consider command-specific env-var in circle 1.0 mapping an env var set in the config panel, like:

- sbt flywayMigrate:
    environment:
      SQL_DB_URL: jdbc:mysql://localhost:3400
      SQL_DB_USER: dbadmin
      SQL_DB_PASSWORD: ${DBADMIN_PW}

Which we would naturally put in a corresponding run in circle 2.0. But, we actually need to

- run:
    name: Migrate DB
    command: SQL_DB_PASSWORD=${DBADMIN_PW} sbt flywayMigrate
    environment:
      SQL_DB_URL: jdbc:mysql://localhost:3400
      SQL_DB_USER: dbadmin

I just had a major headache migrating from Circle 1 to 2.0 because of this. Could the “Migrate from circle 1.0 to 2.0” page be updated perhaps?

This is similar to Environment variable expansion in working_directory but more general


#2

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