mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
different .env include in scripts
This commit is contained in:
parent
90effb41b5
commit
0bd9fed251
@ -10,19 +10,19 @@ PROJECT_ROOT=$SCRIPT_DIR/../..
|
||||
set +o allexport
|
||||
|
||||
# Load backend .env for DB_USERNAME, DB_PASSWORD & DB_DATABASE
|
||||
set -o allexport
|
||||
# NOTE: all config values will be in process.env when starting
|
||||
# the services and will therefore take precedence over the .env
|
||||
if [ -f "$PROJECT_ROOT/backend/.env" ]; then
|
||||
source $PROJECT_ROOT/backend/.env
|
||||
export $(cat $PROJECT_ROOT/backend/.env | sed 's/#.*//g' | xargs)
|
||||
else
|
||||
source $PROJECT_ROOT/backend/.env.dist
|
||||
export $(cat $PROJECT_ROOT/backend/.env.dist | sed 's/#.*//g' | xargs)
|
||||
fi
|
||||
set +o allexport
|
||||
|
||||
# Stop Services
|
||||
pm2 stop all
|
||||
pm2 stop gradido-backend
|
||||
|
||||
# Backup data
|
||||
mysqldump --databases --single-transaction --quick --lock-tables=false > ${SCRIPT_DIR}/backup/mariadb-backup-$(date +%d-%m-%Y_%H-%M-%S).sql -u ${DB_USER} -p${DB_PASSWORD} ${DB_DATABASE}
|
||||
|
||||
# Start Services
|
||||
pm2 start all
|
||||
pm2 start gradido-backend
|
||||
@ -11,13 +11,13 @@ PROJECT_ROOT=$SCRIPT_DIR/../..
|
||||
set +o allexport
|
||||
|
||||
# Load .env or .env.dist if not present
|
||||
set -o allexport
|
||||
# NOTE: all config values will be in process.env when starting
|
||||
# the services and will therefore take precedence over the .env
|
||||
if [ -f "$SCRIPT_DIR/.env" ]; then
|
||||
source $SCRIPT_DIR/.env
|
||||
export $(cat $SCRIPT_DIR/.env | sed 's/#.*//g' | xargs)
|
||||
else
|
||||
source $SCRIPT_DIR/.env.dist
|
||||
export $(cat $SCRIPT_DIR/.env.dist | sed 's/#.*//g' | xargs)
|
||||
fi
|
||||
set +o allexport
|
||||
|
||||
# Configure git
|
||||
git config pull.ff only
|
||||
|
||||
@ -10,16 +10,16 @@ PROJECT_ROOT=$SCRIPT_DIR/../..
|
||||
set +o allexport
|
||||
|
||||
# Load backend .env for DB_USERNAME, DB_PASSWORD & DB_DATABASE
|
||||
set -o allexport
|
||||
# NOTE: all config values will be in process.env when starting
|
||||
# the services and will therefore take precedence over the .env
|
||||
if [ -f "$PROJECT_ROOT/backend/.env" ]; then
|
||||
source $PROJECT_ROOT/backend/.env
|
||||
export $(cat $PROJECT_ROOT/backend/.env | sed 's/#.*//g' | xargs)
|
||||
else
|
||||
source $PROJECT_ROOT/backend/.env.dist
|
||||
export $(cat $PROJECT_ROOT/backend/.env.dist | sed 's/#.*//g' | xargs)
|
||||
fi
|
||||
set +o allexport
|
||||
|
||||
# Stop Services
|
||||
pm2 stop all
|
||||
pm2 stop gradido-backend
|
||||
|
||||
# Backup data
|
||||
mysqldump --databases --single-transaction --quick --lock-tables=false > ${SCRIPT_DIR}/backup/mariadb-restore-backup-$(date +%d-%m-%Y_%H-%M-%S).sql -u ${DB_USER} -p${DB_PASSWORD} ${DB_DATABASE}
|
||||
@ -33,4 +33,4 @@ EOFMYSQL
|
||||
yarn --cwd $PROJECT_ROOT/database up
|
||||
|
||||
# Start Services
|
||||
pm2 start all
|
||||
pm2 start gradido-backend
|
||||
@ -11,14 +11,13 @@ NGINX_CONFIG_DIR=$SCRIPT_DIR/nginx/sites-available
|
||||
set +o allexport
|
||||
|
||||
# Load .env or .env.dist if not present
|
||||
set -o allexport
|
||||
#TODO
|
||||
# NOTE: all config values will be in process.env when starting
|
||||
# the services and will therefore take precedence over the .env
|
||||
if [ -f "$SCRIPT_DIR/.env" ]; then
|
||||
source $SCRIPT_DIR/.env
|
||||
export $(cat $SCRIPT_DIR/.env | sed 's/#.*//g' | xargs)
|
||||
else
|
||||
source $SCRIPT_DIR/.env.dist
|
||||
export $(cat $SCRIPT_DIR/.env.dist | sed 's/#.*//g' | xargs)
|
||||
fi
|
||||
set +o allexport
|
||||
|
||||
# lock start
|
||||
if [ -f $LOCK_FILE ] ; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user