I am working on automating our deployment process. We are using terraform on AWS and we need to setup some environment variable.
Here is how we are currently loading all environment variables coming from
.env (working on MacOS):
# load .env from root project directory set -a # automatically export all variables source ../.env set +a
It looks like this is not working when we run this shell script on CircleCI. Here is our pipeline:
deploy: docker: - image: cimg/base:stable-20.04 steps: - checkout - populate_env - install_aws_cli - install_terraform - run: | # Applying terraform cd deploy ./apply.sh
populate_env command is just reading some env var from CircleCI context to insert them into
The script that should load env var from
Also, we need variable expansion like:
Do you guys have any idea of why it is not working on
cimg/base:stable-20.04 but fine on MacOS?
Thanks in advance,