Add deployment scripts (#18)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
#3 Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/18 Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
58d1541e47
commit
8b3fb062f0
8 changed files with 145 additions and 2 deletions
23
scripts/deploy_stage.sh
Normal file
23
scripts/deploy_stage.sh
Normal file
|
@ -0,0 +1,23 @@
|
|||
#! /bin/bash
|
||||
|
||||
export PATH="$HOME/.yarn/bin:$PATH"
|
||||
export PATH="$HOME/.nodeuse/bin:$PATH"
|
||||
|
||||
export BOT_TOKEN=$(cat $HOME/scripts/card-drop/stage_key.txt)
|
||||
|
||||
cd ~/apps/card-drop/card-drop_stage \
|
||||
&& git checkout develop \
|
||||
&& git fetch \
|
||||
&& git pull \
|
||||
&& docker compose --file docker-compose.stage.yml down \
|
||||
&& (pm2 stop card-drop_stage || true) \
|
||||
&& (pm2 delete card-drop_stage || true) \
|
||||
&& cp .stage.env .env \
|
||||
&& yarn clean \
|
||||
&& yarn install --frozen-lockfile \
|
||||
&& yarn build \
|
||||
&& 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 card-drop_stage dist/bot.js
|
Loading…
Add table
Add a link
Reference in a new issue