McManager/deploy.sh
2025-07-30 16:46:42 +02:00

38 lines
1.3 KiB
Bash

#!/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/