3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Update update scripts and process files

This commit is contained in:
Dragory 2021-09-04 19:57:59 +03:00
parent 200e8ba89d
commit 6486dd7ca8
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
6 changed files with 62 additions and 11 deletions

View file

@ -5,7 +5,8 @@
"cwd": "./backend", "cwd": "./backend",
"script": "npm", "script": "npm",
"args": "run start-api-prod", "args": "run start-api-prod",
"log_date_format": "YYYY-MM-DD HH:mm:ss" "log_date_format": "YYYY-MM-DD HH:mm:ss.SSS",
"exp_backoff_restart_delay": 2500
} }
] ]
} }

View file

@ -5,7 +5,8 @@
"cwd": "./backend", "cwd": "./backend",
"script": "npm", "script": "npm",
"args": "run start-bot-prod", "args": "run start-bot-prod",
"log_date_format": "YYYY-MM-DD HH:mm:ss" "log_date_format": "YYYY-MM-DD HH:mm:ss.SSS",
"exp_backoff_restart_delay": 2500
} }
] ]
} }

16
update-backend-hotfix.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
# Load nvm
. ~/.nvm/nvm.sh
# Run hotfix update
cd backend
nvm use
git pull
npm run build
# Restart processes
cd ..
nvm use
pm2 restart process-bot.json
pm2 restart process-api.json

25
update-backend.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
# Load nvm
. ~/.nvm/nvm.sh
# Stop current processes
nvm use
pm2 delete process-bot.json
pm2 delete process-api.json
# Run update
nvm use
git pull
npm ci
cd backend
npm ci
npm run build
npm run migrate-prod
# Start processes again
cd ..
nvm use
pm2 start process-bot.json
pm2 start process-api.json

15
update-dashboard.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
TARGET_DIR=/var/www/zeppelin.gg
# Load nvm
. ~/.nvm/nvm.sh
# Update dashboard
cd dashboard
git pull
nvm use
npm ci
npm run build
rm -r "$TARGET_DIR/*"
cp -R dist/* "$TARGET_DIR"

View file

@ -1,11 +1,4 @@
#!/bin/bash #!/bin/bash
# Load nvm . ./update-backend.sh
. ~/.nvm/nvm.sh . ./update-dashboard.sh
# Run update
nvm use
git pull
npm ci
npm run build
pm2 restart process.json