update the scripts to source ~/.bashrc in hopes of making sure that npm, turbo, etc. are available
27 lines
No EOL
577 B
Bash
Executable file
27 lines
No EOL
577 B
Bash
Executable file
#!/bin/bash
|
|
|
|
#
|
|
# Deployment script to be run remotely on push to master at https://github.com/ViossaDiskordServer/ViossaDotNet/
|
|
#
|
|
# Usage: sh ./deploy.sh SOURCE_DIR STATIC_DIR BACKEND_DIR
|
|
#
|
|
|
|
SOURCE_DIR=$1
|
|
STATIC_DIR=$2
|
|
BACKEND_DIR=$3
|
|
|
|
pwd
|
|
source ~/.bashrc # make sure NPM commands etc are available
|
|
npm i -g pnpm && pnpm setup
|
|
which pm2 || pnpm i pm2 -g
|
|
cd $SOURCE_DIR
|
|
pnpm i
|
|
npx turbo build
|
|
|
|
mkdir -p $STATIC_DIR
|
|
mkdir -p $BACKEND_DIR
|
|
cp -r $SOURCE_DIR/apps/vdn-static/dist/* "$STATIC_DIR"
|
|
cp -r $SOURCE_DIR/apps/vdb-backend/dist/* "$BACKEND_DIR"
|
|
cd $BACKEND_DIR
|
|
|
|
pm2 start . |