Update scripts

This commit is contained in:
Ethan Lane 2022-12-27 15:22:11 +00:00
parent a3e062a1ff
commit a001e63857
3 changed files with 9 additions and 6 deletions

View file

@ -5,6 +5,7 @@
"main": "./dist/vylbot",
"typings": "./dist",
"scripts": {
"clean": "rm -rf node_modules/ dist/",
"build": "tsc",
"start": "node ./dist/vylbot",
"test": "jest",

View file

@ -1,7 +1,7 @@
#! /bin/bash
export PATH="$HOME/.yarn/bin:$PATH"
export PATH="$HOME/.nvm/versions/node/v16.17.0/bin/:$PATH"
export PATH="$HOME/.nodeuse/bin:$PATH"
export BOT_TOKEN=$(cat $HOME/scripts/vylbot/prod_key.txt)
@ -9,14 +9,15 @@ cd ~/apps/vylbot/vylbot_prod \
&& git checkout main \
&& git fetch \
&& git pull \
&& docker-compose --file docker-compose.prod.yml down \
&& docker compose --file docker-compose.prod.yml down \
&& (pm2 stop vylbot_prod || true) \
&& (pm2 delete vylbot_prod || true) \
&& cp .prod.env .env \
&& cp ormconfig.prod.json ormconfig.json \
&& yarn clean \
&& yarn install --frozen-lockfile \
&& yarn build \
&& docker-compose --file docker-compose.prod.yml up -d \
&& docker compose --file docker-compose.prod.yml up -d \
&& echo "Sleeping for 10 seconds to let database load..." \
&& sleep 10 \
&& yarn run db:up \

View file

@ -1,7 +1,7 @@
#! /bin/bash
export PATH="$HOME/.yarn/bin:$PATH"
export PATH="$HOME/.nvm/versions/node/v16.17.0/bin/:$PATH"
export PATH="$HOME/.nodeuse/bin:$PATH"
export BOT_TOKEN=$(cat $HOME/scripts/vylbot/stage_key.txt)
@ -9,14 +9,15 @@ cd ~/apps/vylbot/vylbot_stage \
&& git checkout develop \
&& git fetch \
&& git pull \
&& docker-compose --file docker-compose.stage.yml down \
&& docker compose --file docker-compose.stage.yml down \
&& (pm2 stop vylbot_stage || true) \
&& (pm2 delete vylbot_stage || true) \
&& cp .stage.env .env \
&& cp ormconfig.stage.json ormconfig.json \
&& yarn clean \
&& yarn install --frozen-lockfile \
&& yarn build \
&& docker-compose --file docker-compose.stage.yml up -d \
&& docker compose --file docker-compose.stage.yml up -d \
&& echo "Sleeping for 10 seconds to let database load..." \
&& sleep 10 \
&& yarn run db:up \