mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-21 22:50:59 -05:00
chore: add build / publish script [skip ci]
This commit is contained in:
parent
0f3b1b0491
commit
2e13685998
1 changed files with 28 additions and 5 deletions
|
@ -1,7 +1,30 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
version=$(cat VERSION)
|
# Build and publish release to production server
|
||||||
|
|
||||||
|
# Remote Server
|
||||||
|
REMOTE=revolt-de-nrb-1
|
||||||
|
|
||||||
|
# Remote Directory
|
||||||
|
REMOTE_DIR=/root/revite
|
||||||
|
|
||||||
|
# Post-install script
|
||||||
|
POST_INSTALL="pm2 restart revite"
|
||||||
|
|
||||||
|
# Assets
|
||||||
|
export REVOLT_SASS=https://github.com/revoltchat/assets
|
||||||
|
|
||||||
|
|
||||||
|
# 1. Build Revite
|
||||||
|
yarn
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
docker build -t revoltchat/client:${version} . &&
|
|
||||||
docker tag revoltchat/client:${version} revoltchat/client:latest &&
|
|
||||||
docker push revoltchat/client:${version} &&
|
|
||||||
docker push revoltchat/client:latest
|
|
||||||
|
|
Loading…
Reference in a new issue