chore: update build_image.sh

This commit is contained in:
Paul Pan 2023-12-23 19:59:59 +08:00
parent 212511d7b4
commit 1bcb797753
Signed by: Paul
GPG Key ID: D639BDF5BA578AF4

View File

@ -13,7 +13,7 @@ function build_base() {
(log_error "Build Full Image failed" && exit 1) (log_error "Build Full Image failed" && exit 1)
$DOCKER build -t git.0x7f.app/woj/ubuntu-run:latest -f scripts/ubuntu-run.Dockerfile . || $DOCKER build -t git.0x7f.app/woj/ubuntu-run:latest -f scripts/ubuntu-run.Dockerfile . ||
(log_error "Build Tiny Image failed" && exit 1) (log_error "Build Tiny Image failed" && exit 1)
popd popd || exit 1
} }
function push_base() { function push_base() {
@ -53,9 +53,27 @@ function push_runner() {
$DOCKER push "git.0x7f.app/woj/woj-runner:$VERSION" $DOCKER push "git.0x7f.app/woj/woj-runner:$VERSION"
} }
if [ "$1" == "base" ]; then
build_base
push_base
exit 0
elif [ "$1" == "server" ]; then
build_server
push_server
exit 0
elif [ "$1" == "runner" ]; then
build_runner
push_runner
exit 0
elif [ "$1" == "all" ]; then
build_base build_base
push_base push_base
build_server build_server
push_server push_server
build_runner build_runner
push_runner push_runner
exit 0
else
log_error "Usage: $0 [base|server|runner|all]"
exit 1
fi