mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-06 01:25:28 +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
|
set +o allexport
|
||||||
|
|
||||||
# Load backend .env for DB_USERNAME, DB_PASSWORD & DB_DATABASE
|
# 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
|
if [ -f "$PROJECT_ROOT/backend/.env" ]; then
|
||||||
source $PROJECT_ROOT/backend/.env
|
export $(cat $PROJECT_ROOT/backend/.env | sed 's/#.*//g' | xargs)
|
||||||
else
|
else
|
||||||
source $PROJECT_ROOT/backend/.env.dist
|
export $(cat $PROJECT_ROOT/backend/.env.dist | sed 's/#.*//g' | xargs)
|
||||||
fi
|
fi
|
||||||
set +o allexport
|
|
||||||
|
|
||||||
# Stop Services
|
# Stop Services
|
||||||
pm2 stop all
|
pm2 stop gradido-backend
|
||||||
|
|
||||||
# Backup data
|
# 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}
|
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
|
# Start Services
|
||||||
pm2 start all
|
pm2 start gradido-backend
|
||||||
@ -11,13 +11,13 @@ PROJECT_ROOT=$SCRIPT_DIR/../..
|
|||||||
set +o allexport
|
set +o allexport
|
||||||
|
|
||||||
# Load .env or .env.dist if not present
|
# 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
|
if [ -f "$SCRIPT_DIR/.env" ]; then
|
||||||
source $SCRIPT_DIR/.env
|
export $(cat $SCRIPT_DIR/.env | sed 's/#.*//g' | xargs)
|
||||||
else
|
else
|
||||||
source $SCRIPT_DIR/.env.dist
|
export $(cat $SCRIPT_DIR/.env.dist | sed 's/#.*//g' | xargs)
|
||||||
fi
|
fi
|
||||||
set +o allexport
|
|
||||||
|
|
||||||
# Configure git
|
# Configure git
|
||||||
git config pull.ff only
|
git config pull.ff only
|
||||||
|
|||||||
@ -10,16 +10,16 @@ PROJECT_ROOT=$SCRIPT_DIR/../..
|
|||||||
set +o allexport
|
set +o allexport
|
||||||
|
|
||||||
# Load backend .env for DB_USERNAME, DB_PASSWORD & DB_DATABASE
|
# 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
|
if [ -f "$PROJECT_ROOT/backend/.env" ]; then
|
||||||
source $PROJECT_ROOT/backend/.env
|
export $(cat $PROJECT_ROOT/backend/.env | sed 's/#.*//g' | xargs)
|
||||||
else
|
else
|
||||||
source $PROJECT_ROOT/backend/.env.dist
|
export $(cat $PROJECT_ROOT/backend/.env.dist | sed 's/#.*//g' | xargs)
|
||||||
fi
|
fi
|
||||||
set +o allexport
|
|
||||||
|
|
||||||
# Stop Services
|
# Stop Services
|
||||||
pm2 stop all
|
pm2 stop gradido-backend
|
||||||
|
|
||||||
# Backup data
|
# 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}
|
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
|
yarn --cwd $PROJECT_ROOT/database up
|
||||||
|
|
||||||
# Start Services
|
# Start Services
|
||||||
pm2 start all
|
pm2 start gradido-backend
|
||||||
@ -11,14 +11,13 @@ NGINX_CONFIG_DIR=$SCRIPT_DIR/nginx/sites-available
|
|||||||
set +o allexport
|
set +o allexport
|
||||||
|
|
||||||
# Load .env or .env.dist if not present
|
# Load .env or .env.dist if not present
|
||||||
set -o allexport
|
# NOTE: all config values will be in process.env when starting
|
||||||
#TODO
|
# the services and will therefore take precedence over the .env
|
||||||
if [ -f "$SCRIPT_DIR/.env" ]; then
|
if [ -f "$SCRIPT_DIR/.env" ]; then
|
||||||
source $SCRIPT_DIR/.env
|
export $(cat $SCRIPT_DIR/.env | sed 's/#.*//g' | xargs)
|
||||||
else
|
else
|
||||||
source $SCRIPT_DIR/.env.dist
|
export $(cat $SCRIPT_DIR/.env.dist | sed 's/#.*//g' | xargs)
|
||||||
fi
|
fi
|
||||||
set +o allexport
|
|
||||||
|
|
||||||
# lock start
|
# lock start
|
||||||
if [ -f $LOCK_FILE ] ; then
|
if [ -f $LOCK_FILE ] ; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user