deploy-frontend.sh

This commit is contained in:
Patrick Haßel 2025-11-03 11:41:16 +01:00
parent eebb917a6d
commit cd7b755880
2 changed files with 18 additions and 1 deletions

18
deploy-frontend.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
cd "$(dirname "$0")/src/main/angular/" || exit 1
if git diff --quiet && git diff --cached --quiet && [ -z "$(git ls-files --others --exclude-standard)" ]; then
if ng build; then
TAG="DEPLOY---FRONTEND---$(date +'%Y-%m-%d---%H-%M-%S')"
git rev-parse HEAD > dist/angular/browser/git.hash
echo "$TAG" > dist/angular/browser/git.tag
rsync --archive --delete -e 'ssh -p2222' dist/angular/browser/ root@10.255.0.1:/srv/Data2025/www/ --progress
git tag "$TAG"
else
echo "ng build failed! Aborting..."
fi
else
echo "git has changes! Aborting..."
exit 1
fi

View File

@ -5,7 +5,6 @@
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"deploy": "ng build && rsync --archive --delete -e 'ssh -p2222' dist/angular/browser/ root@10.255.0.1:/srv/Data2025/www/ --progress",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test"
}, },