vylbot-app/scripts/deploy_stage.sh

23 lines
681 B
Bash
Raw Normal View History

#! /bin/bash
export PATH="$HOME/.yarn/bin:$PATH"
2022-12-27 15:22:11 +00:00
export PATH="$HOME/.nodeuse/bin:$PATH"
2022-09-06 19:37:06 +01:00
export BOT_TOKEN=$(cat $HOME/scripts/vylbot/stage_key.txt)
cd ~/apps/vylbot/vylbot_stage \
&& git checkout develop \
&& git fetch \
&& git pull \
2022-12-27 15:22:11 +00:00
&& docker compose --file docker-compose.stage.yml down \
&& (pm2 stop vylbot_stage || true) \
&& (pm2 delete vylbot_stage || true) \
&& cp .stage.env .env \
2022-12-27 15:22:11 +00:00
&& yarn clean \
&& yarn install --frozen-lockfile \
&& yarn build \
2022-12-27 15:22:11 +00:00
&& docker compose --file docker-compose.stage.yml up -d \
&& echo "Sleeping for 10 seconds to let database load..." \
&& sleep 10 \
&& yarn run db:up \
&& NODE_ENV=production pm2 start --name vylbot_stage dist/vylbot.js