Files
HangmanLab/docker_publish
2025-03-05 17:33:17 +00:00

40 lines
862 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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