From e3ba5800c0204cac9abe926062bdc80dcae7c3b5 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Tue, 9 Oct 2018 10:02:57 +0400 Subject: [PATCH] dk: corriger push --- dk | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/dk b/dk index 8fc9cff..37f789d 100755 --- a/dk +++ b/dk @@ -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() {