deploy-frontend.sh
This commit is contained in:
parent
eebb917a6d
commit
cd7b755880
18
deploy-frontend.sh
Normal file
18
deploy-frontend.sh
Normal 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
|
||||
@ -5,7 +5,6 @@
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"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",
|
||||
"test": "ng test"
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user