dk: corriger push

This commit is contained in:
Jephté Clain 2018-10-09 10:02:57 +04:00
parent 48c662be2e
commit e3ba5800c0
1 changed files with 16 additions and 7 deletions

23
dk
View File

@ -91,7 +91,10 @@ function initialize_build_env() {
TAGS=(latest)
VERSION=
}
function default_update_build_env() { :; }
function default_update_build_env() {
[ -n "$VERSION" ] || docker_add_build_arg VERSION "$(get_version)"
[ -n "$VERSION" ] && TAGS+=("$VERSION")
}
function update_build_env() { default_update_build_env; }
function default_compose_build() {
@ -101,8 +104,6 @@ function default_compose_build() {
"$@"
}
function default_docker_build() {
[ -n "$VERSION" ] || docker_add_build_arg VERSION "$(get_version)"
[ -n "$VERSION" ] && TAGS+=("$VERSION")
local tag
for tag in "${TAGS[@]}"; do
replace_build_args+=(-t "$NAME:$tag")
@ -132,13 +133,21 @@ function auto_build() {
}
function auto_push() {
local -a tags tag
local -a replace_env_args env_args
local -a replace_build_args build_args
local tag
initialize_build_env
update_build_env
if [ -f docker-compose.yml ]; then
compose_set_env_args
update_build_env
else
docker_parse_env_args
docker_check_name
update_build_env
fi
for tag in "${TAGS[@]}"; do
tags+=("$NAME:$tag")
docker push "$NAME:$tag"
done
docker push "${tags[@]}"
}
function default_compose_up() {