Container environment not overriding project environment

Given a project with project environment variables and a config with container environment variables of the same name, I would expect the container environment variables to take precedence over the project environment variables based on the precedence rules here.

Example config

version: 2
jobs:
  test:
    docker:
      - image: circleci/python:3.5
        environment:
          TEST_USER: userb
          TEST_PASS: passb

    steps:
      - checkout
      - run: echo $TEST_USER && echo $TEST_PASS

workflows:
  version: 2
  test:
    jobs:
      - test

Given the above config with project env vars TEST_USER=usera and TEST_PASS=passa Iā€™d expect the output to be

userb
passb

but the actual output is

usera
passa

Setting these env vars at the job level does override the project env vars but not at the container level.

1 Like

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