Context environment variables are empty even though they have been set

I am trying to use context environment variables in my config.yml using version 2.0. I’ve created the environment variables in the context and added the context to the config file so that I should be able to reference them. The problem is when I use them to login to dockerhub, they are null. A password: EOF error is given.
How can I reference the environment variables from the context and not have them be null?
Config file is as such:

version: 2.0

jobs:
 build:
   context: MotivLabs
   branches:
     only:
       - master
#docker:
#  - image: docker/compose:1.25.3

    machine:
      image: ubuntu-1604:201903-01

    steps:
      - checkout

      - run:
          name: Running Unit Tests
          command: |
            echo "Setting Unit Test Image Name"
            IMAGE_TEST_NAME="motivlabs/github-taxi-dispatcher-unit:$(date +%Y%m%d%H%M%S)-${CIRCLE_SHA1:0:6}"
            echo "Image Test Name"
            echo $IMAGE_TEST_NAME

            echo "Building Unit Test Image"
            docker build -f docker-tools/Dockerfile --target=unit-test -t ${IMAGE_TEST_NAME} .
            echo "Finished Building Unit Test Image"

            echo "Running Test Image"
            docker run $IMAGE_TEST_NAME
            echo "Finished Running Unit Tests Image"
      - run:
          name: Running Integration Test and Push Images
          command: |
            echo "Setting Image Name"
            IMAGE_NAME="motivlabs/github-taxi-dispatcher:$(date +%Y%m%d%H%M%S)-${CIRCLE_SHA1:0:6}"
            echo "Image Name"
            echo $IMAGE_NAME

            echo "Building Service Image"
            docker build -f docker-tools/Dockerfile --target=prod -t ${IMAGE_NAME} -t motivlabs/github-taxi-dispatcher:latest .
            echo "Finished Building Service Image"

            echo "Running Integration Tests"
            docker-compose -f docker-tools/docker-compose.yml --version
            docker-compose -f docker-tools/docker-compose.yml -f docker-tools/docker-compose-itest.yml up --exit-code-from integration-tests
            echo "Finished Integration Tests"
            docker-compose -f docker-tools/docker-compose.yml -f docker-tools/docker-compose-itest.yml down

            echo "Logging in to Docker Hub"
            docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
            echo "Pushing Service Images to Docker Hub"
            docker push $IMAGE_NAME
            echo "Pushed Extended Image Name"
            docker push motivlabs/github-taxi-dispatcher:latest
            echo "Pushed Latest Image Name"

I believe that the issue may revolve around using the machine executor type. This could be causing issues with being able to access the environment variables. IF this is the case, how would I set environment variables for a machine executor type to access? Since the environment variables are authentication credentials I can’t just set them in the config file.

got it. Used workflows to access context and such.

Hi @tuxranger,

That’s correct. You need to refer to your context(s) within workflows.

You can find more information about using contexts in our documentation.