use the new env variable GRADIDO_ENV_NAME to init NODE_ENV

This commit is contained in:
Claus-Peter Hübner 2022-09-20 18:21:24 +02:00
parent ae01f99c36
commit 34071fd9b4

View File

@ -120,8 +120,8 @@ yarn build
if [ "$DEPLOY_SEED_DATA" = "true" ]; then if [ "$DEPLOY_SEED_DATA" = "true" ]; then
yarn seed yarn seed
fi fi
# TODO maybe handle this differently? # the env variable GRADIDO_ENV_NAME have to be set during system installation manually (development, stage1, stage2, stage3) if it should differ from production
export NODE_ENV=production export NODE_ENV="${GRADIDO_ENV_NAME:=production}"
pm2 delete gradido-backend pm2 delete gradido-backend
pm2 start --name gradido-backend "yarn --cwd $PROJECT_ROOT/backend start" -l $GRADIDO_LOG_PATH/pm2.backend.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 start --name gradido-backend "yarn --cwd $PROJECT_ROOT/backend start" -l $GRADIDO_LOG_PATH/pm2.backend.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS'
pm2 save pm2 save
@ -133,8 +133,8 @@ cd $PROJECT_ROOT/frontend
unset NODE_ENV unset NODE_ENV
yarn install yarn install
yarn build yarn build
# TODO maybe handle this differently? # the env variable GRADIDO_ENV_NAME have to be set during system installation manually (development, stage1, stage2, stage3) if it should differ from production
export NODE_ENV=production export NODE_ENV="${GRADIDO_ENV_NAME:=production}"
pm2 delete gradido-frontend pm2 delete gradido-frontend
pm2 start --name gradido-frontend "yarn --cwd $PROJECT_ROOT/frontend start" -l $GRADIDO_LOG_PATH/pm2.frontend.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 start --name gradido-frontend "yarn --cwd $PROJECT_ROOT/frontend start" -l $GRADIDO_LOG_PATH/pm2.frontend.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS'
pm2 save pm2 save
@ -146,8 +146,8 @@ cd $PROJECT_ROOT/admin
unset NODE_ENV unset NODE_ENV
yarn install yarn install
yarn build yarn build
# TODO maybe handle this differently? # the env variable GRADIDO_ENV_NAME have to be set during system installation manually (development, stage1, stage2, stage3) if it should differ from production
export NODE_ENV=production export NODE_ENV="${GRADIDO_ENV_NAME:=production}"
pm2 delete gradido-admin pm2 delete gradido-admin
pm2 start --name gradido-admin "yarn --cwd $PROJECT_ROOT/admin start" -l $GRADIDO_LOG_PATH/pm2.admin.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 start --name gradido-admin "yarn --cwd $PROJECT_ROOT/admin start" -l $GRADIDO_LOG_PATH/pm2.admin.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS'
pm2 save pm2 save