deploy-backend.sh

This commit is contained in:
Patrick Haßel 2025-11-03 11:49:20 +01:00
parent cd7b755880
commit d962dcefa9

19
deploy-backend.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
cd "$(dirname "$0")" || exit 1
if ! ( git diff --quiet && git diff --cached --quiet && [ -z "$(git ls-files --others --exclude-standard)" ] ); then
echo "git has changes! Aborting..."
exit 1
fi
if ! mvn clean install; then
echo "mvn clean install failed! Aborting..."
exit 1
fi
TAG="DEPLOY---BACKEND---$(date +'%Y-%m-%d---%H-%M-%S')"
ssh root@10.255.0.1 -p 2222 "systemctl stop Data2025.service"
rsync -e 'ssh -p2222' target/Data2025.jar root@10.255.0.1:/srv/Data2025/ --progress
ssh root@10.255.0.1 -p 2222 "systemctl start Data2025.service"
git tag "$TAG"