Streamlined dev vs prod config management

This commit is contained in:
2025-04-24 13:21:00 +01:00
parent c6f5375af8
commit f760727d9e
10 changed files with 39 additions and 32 deletions

15
env.sh Executable file
View 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"