deploy.sh

This commit is contained in:
Patrick Haßel 2025-07-30 16:46:42 +02:00
parent 6ee826f94b
commit a7fdb28ed8
2 changed files with 38 additions and 1 deletions

37
deploy.sh Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
cd "$(dirname "$0")" || exit 1
echo "+---------------------------------------------------+"
echo "| Building backend |"
echo "+---------------------------------------------------+"
mvn clean install || exit 1
echo "+---------------------------------------------------+"
echo "| Uploading backend |"
echo "+---------------------------------------------------+"
rsync --archive -e 'ssh -p 2222' ./target/McManager.jar mc@mc.ph87.de:/srv/McManager/ || exit 1
echo "+---------------------------------------------------+"
echo "| Restarting backend |"
echo "+---------------------------------------------------+"
ssh root@mc.ph87.de -p 2222 'systemctl restart McManager.service' || exit 1
echo "+---------------------------------------------------+"
echo "| Building frontend |"
echo "+---------------------------------------------------+"
cd src/main/angular || exit 1
npm run build || exit 1
echo "+---------------------------------------------------+"
echo "| Uploading frontend |"
echo "+---------------------------------------------------+"
rsync --archive --delete -e 'ssh -p 2222' ./dist/angular/browser/ mc@mc.ph87.de:/srv/McManager/www/

View File

@ -4,7 +4,7 @@
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build && rsync --archive --delete -e 'ssh -p 2222' ./dist/angular/browser/ mc@mc.ph87.de:/srv/McManager/www/", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test"
}, },