2021-06-22 14:34:52 -04:00
|
|
|
#!/bin/bash
|
2022-05-24 08:17:30 -04:00
|
|
|
# Build and publish release to production server
|
|
|
|
|
|
|
|
# Remote Server
|
2022-11-06 08:26:41 -05:00
|
|
|
if [ -z "$REMOTE" ]; then
|
|
|
|
echo "Please set REMOTE!"
|
|
|
|
exit
|
|
|
|
fi
|
2022-05-24 08:17:30 -04:00
|
|
|
|
|
|
|
# Remote Directory
|
|
|
|
REMOTE_DIR=/root/revite
|
|
|
|
|
|
|
|
# Post-install script
|
|
|
|
POST_INSTALL="pm2 restart revite"
|
|
|
|
|
|
|
|
# Assets
|
2022-05-24 08:18:47 -04:00
|
|
|
export REVOLT_SAAS=https://github.com/revoltchat/assets
|
2022-05-24 08:17:30 -04:00
|
|
|
|
|
|
|
|
2022-08-09 06:36:16 -04:00
|
|
|
# Exit when any command fails
|
|
|
|
set -e
|
|
|
|
|
2022-05-24 08:17:30 -04:00
|
|
|
# 1. Build Revite
|
2023-02-22 11:59:38 -05:00
|
|
|
yarn build:highmem
|
2022-05-24 08:17:30 -04:00
|
|
|
|
|
|
|
# 2. Archive built files
|
|
|
|
tar -czvf build.tar.gz dist
|
|
|
|
|
|
|
|
# 3. Upload built files
|
|
|
|
scp build.tar.gz $REMOTE:$REMOTE_DIR/build.tar.gz
|
|
|
|
rm build.tar.gz
|
|
|
|
|
|
|
|
# 4. Apply changes
|
|
|
|
ssh $REMOTE "cd $REMOTE_DIR; tar -xvzf build.tar.gz; rm build.tar.gz; $POST_INSTALL"
|
2021-06-22 14:34:52 -04:00
|
|
|
|