Django deployment with Elastic beanstalk (environment variables)

0

I have a working EB environment when I'm setting environment variables in .config files. I'm deploying with eb cli. All the variables are also listed in the web interface (as they are automatically added). When I'm removing the environment.config file, which I would like to do because I'm want an extra environment with different variable values, deploy fails.

I expose the variables through the terminal with:

/opt/elasticbeanstalk/bin/get-config environment | jq -r 'to_entries | .[] | "export (.key)="(.value)""' > /etc/profile.d/sh.local

and performing these migration commands:

container_commands: 01_migrate: command: "source /var/app/venv//bin/activate && python3 manage.py migrate --noinput" leader_only: true 02_superuser: command: "source /var/app/venv//bin/activate && python3 manage.py createsuperuserifnotexists" leader_only: true

Are the web env variables available during the migration commands?

Thanks in advance.

Eric
質問済み 1年前118ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ