mirror of
https://github.com/Cian-H/iform-invenio.git
synced 2025-12-22 20:41:56 +00:00
Streamlined dev vs prod config management
This commit is contained in:
15
env.sh
Executable file
15
env.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
if [[ "$*" == *--dev* ]]; then
|
||||
echo "Configuring env in development mode"
|
||||
ENV_FILE="invenio_dev.env"
|
||||
else
|
||||
echo "Configuring env in production mode"
|
||||
ENV_FILE="invenio_prod.env"
|
||||
fi
|
||||
|
||||
aws secretsmanager get-secret-value --secret-id Invenio | \
|
||||
jq -r '.SecretString | fromjson | to_entries | .[] | .key + "=\"" + .value + "\""' > secrets.env
|
||||
|
||||
cat ./env/invenio.env "./env/$ENV_FILE" secrets.env > .env
|
||||
|
||||
echo "Environment set up using $ENV_FILE"
|
||||
Reference in New Issue
Block a user