dk: rendre overridable VERSION
This commit is contained in:
parent
ed180b5bfb
commit
56b18a4eb6
20
dk
20
dk
|
@ -91,6 +91,8 @@ function default_compose_build() {
|
||||||
"$@"
|
"$@"
|
||||||
}
|
}
|
||||||
function default_docker_build() {
|
function default_docker_build() {
|
||||||
|
[ -n "$VERSION" ] || docker_add_build_arg VERSION "$(get_version)"
|
||||||
|
replace_build_args+=(-t "$NAME:$VERSION" -t "$NAME:latest")
|
||||||
docker build \
|
docker build \
|
||||||
"${replace_env_args[@]}" "${env_args[@]}" \
|
"${replace_env_args[@]}" "${env_args[@]}" \
|
||||||
"${replace_build_args[@]}" "${build_args[@]}" \
|
"${replace_build_args[@]}" "${build_args[@]}" \
|
||||||
|
@ -110,9 +112,7 @@ function auto_build() {
|
||||||
else
|
else
|
||||||
docker_parse_env_args
|
docker_parse_env_args
|
||||||
docker_check_name
|
docker_check_name
|
||||||
[ -n "$VERSION" ] || docker_add_build_arg VERSION "$(get_version)"
|
|
||||||
docker_add_build_arg build_date "$(date +%y%m%d)"
|
docker_add_build_arg build_date "$(date +%y%m%d)"
|
||||||
replace_build_args+=(-t "$NAME:$VERSION" -t "$NAME:latest")
|
|
||||||
docker_build
|
docker_build
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ while [ $# -gt 0 ]; do
|
||||||
[ "$1" == -- ] && { shift; continue; }
|
[ "$1" == -- ] && { shift; continue; }
|
||||||
cmd="$1"; shift
|
cmd="$1"; shift
|
||||||
case "$cmd" in
|
case "$cmd" in
|
||||||
build)
|
b|build)
|
||||||
[ -f .build.scripts.sh ] && source ./.build.scripts.sh
|
[ -f .build.scripts.sh ] && source ./.build.scripts.sh
|
||||||
[ -f build.scripts.sh ] && source ./build.scripts.sh
|
[ -f build.scripts.sh ] && source ./build.scripts.sh
|
||||||
args=()
|
args=()
|
||||||
|
@ -260,26 +260,26 @@ while [ $# -gt 0 ]; do
|
||||||
done
|
done
|
||||||
auto_build "${args[@]}" || die
|
auto_build "${args[@]}" || die
|
||||||
;;
|
;;
|
||||||
run|start)
|
s|run|start)
|
||||||
args=()
|
args=()
|
||||||
while [ $# -gt 0 -a "$1" != -- ]; do
|
while [ $# -gt 0 -a "$1" != -- ]; do
|
||||||
args+=("$1"); shift
|
args+=("$1"); shift
|
||||||
done
|
done
|
||||||
auto_up "${args[@]}" || die
|
auto_up "${args[@]}" || die
|
||||||
;;
|
;;
|
||||||
stop)
|
k|stop)
|
||||||
auto_stop || die
|
auto_stop || die
|
||||||
;;
|
;;
|
||||||
up)
|
1|up)
|
||||||
args=()
|
args=()
|
||||||
while [ $# -gt 0 -a "$1" != -- ]; do
|
while [ $# -gt 0 -a "$1" != -- ]; do
|
||||||
args+=("$1"); shift
|
args+=("$1"); shift
|
||||||
done
|
done
|
||||||
auto_up "${args[@]}" && auto_logs || die
|
auto_up "${args[@]}" && auto_logs || die
|
||||||
;;
|
;;
|
||||||
logs) auto_logs || die;;
|
l|logs) auto_logs || die;;
|
||||||
down) auto_down || die;;
|
0|down) auto_down || die;;
|
||||||
brd)
|
d|brd)
|
||||||
do_auto_down=1
|
do_auto_down=1
|
||||||
function auto_down_trap() {
|
function auto_down_trap() {
|
||||||
[ -n "$do_auto_down" ] && auto_down
|
[ -n "$do_auto_down" ] && auto_down
|
||||||
|
@ -305,7 +305,7 @@ while [ $# -gt 0 ]; do
|
||||||
done
|
done
|
||||||
docker image rm "${args[@]}" || die
|
docker image rm "${args[@]}" || die
|
||||||
;;
|
;;
|
||||||
prune)
|
X|prune)
|
||||||
docker container prune -f || die
|
docker container prune -f || die
|
||||||
docker image prune -f || die
|
docker image prune -f || die
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue