mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 03:37:56 +01:00
Add .env file for docker-compose
This commit is contained in:
19
check-env.sh
Normal file
19
check-env.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e # Abort on error
|
||||
|
||||
function check_env_vars () {
|
||||
for name; do
|
||||
: ${!name:?$name must not be empty}
|
||||
done
|
||||
}
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
echo 'A .env file must be present.'
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if ! check_env_vars "ENVIRONMENT" "APP_NAME" "POSTGRES_USER" "POSTGRES_PASSWORD"; then
|
||||
echo 'Some variables are not set in .env, please refer to script/check-env.sh for the list'
|
||||
exit 4
|
||||
fi
|
||||
Reference in New Issue
Block a user