add: auto link feature

This commit is contained in:
h z
2025-01-17 16:33:39 +00:00
parent 41a6d68ab5
commit e68641f7f4
3 changed files with 42 additions and 2 deletions

40
docker_publish Normal file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
cd "$(dirname "$0")"
BUILD_BACKEND=false
BUILD_FRONTEND=false
if [ $# -eq 0 ]; then
BUILD_BACKEND=true
BUILD_FRONTEND=true
else
for arg in "$@"; do
case $arg in
--backend)
BUILD_BACKEND=true
;;
--frontend)
BUILD_FRONTEND=true
;;
*)
echo "unknown$arg"
echo "usage: $0 [ --backend | --frontend ]"
exit 1
;;
esac
done
fi
if [ "$BUILD_BACKEND" = true ]; then
cd HangmanLab.Backend
docker build -t git.hangman-lab.top/hzhang/hangmanlab-backend:latest .
docker push git.hangman-lab.top/hzhang/hangmanlab-backend:latest
cd ..
fi
if [ "$BUILD_FRONTEND" = true ]; then
cd HangmanLab.Frontend
docker build -t git.hangman-lab.top/hzhang/hangmanlab-frontend:latest .
docker push git.hangman-lab.top/hzhang/hangmanlab-frontend:latest
cd ..
fi