Improve ./up syntax

This commit is contained in:
Myve 2024-07-23 05:47:32 +00:00
commit 59c77784f3
3 changed files with 62 additions and 18 deletions

View file

@ -5,7 +5,23 @@
# docker build . \
# --build-arg debug=${debug:-""} \
# --tag ${buildtag:-myvnc/novnc}
# Grab options
while [ ${1} ]
do
case ${1} in
build) docker compose up --build --detach;;
*) docker compose up --detach;;
-b | --build | b | build )
build="--build"
;;
-d | --detach | d | detach )
detach="--detach"
;;
bd | db )
build="--build"
detach="--detach"
;;
esac
shift
done
# Compose up
docker compose up ${build} ${detach}

View file

@ -5,14 +5,26 @@
# docker build . \
# --build-arg debug=${debug:-""} \
# --tag ${buildtag:-myvnc/novnc}
case ${2} in
build) build="--build"
# Grab options
while [ ${1} ]
do
case ${1} in
-b | --build | b | build )
build="--build"
;;
-d | --detach | d | detach )
detach="--detach"
;;
bd | db )
build="--build"
detach="--detach"
;;
590[0-9] )
envar="MYVNC_NOVNC_VNCSSH_PORT=${1}"
;;
esac
shift
done
if [[ ${1} =~ ^[0-9]+$ ]]
then
MYVNC_NOVNC_VNCSSH_PORT=${1} docker compose up ${build} --detach
else
docker compose up ${build} --detach
fi
# Compose up
${envar} docker compose up ${build} ${detach}

View file

@ -5,7 +5,23 @@
# docker build . \
# --build-arg debug=${debug:-""} \
# --tag ${buildtag:-myvnc/novnc}
# Grab options
while [ ${1} ]
do
case ${1} in
build) docker compose up --build --detach;;
*) docker compose up --detach;;
-b | --build | b | build )
build="--build"
;;
-d | --detach | d | detach )
detach="--detach"
;;
bd | db )
build="--build"
detach="--detach"
;;
esac
shift
done
# Compose up
docker compose up ${build} ${detach}