From 2803868e16072fc24f8b5fe73b45329b84ed8189 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Mon, 2 Oct 2023 19:31:07 +0400 Subject: [PATCH] =?UTF-8?q?dkbuild:=20marquer=20plus=20d'action=20comme=20?= =?UTF-8?q?=C3=A9tant=20du=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dkbuild | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dkbuild b/dkbuild index f2cf29e..dd09277 100755 --- a/dkbuild +++ b/dkbuild @@ -1834,6 +1834,7 @@ function define_functions_cmd() { shift done + [ -n "${DEFAULTS[build_build]-1}" ] || return [ -n "$output" ] || die "genfile: Vous devez spécifier le fichier en sortie" if [ -n "$context" ]; then mkdir -p "$context" || die @@ -1869,6 +1870,7 @@ function define_functions_cmd() { shift done + [ -n "${DEFAULTS[build_build]-1}" ] || return [ -n "$DOCKERFILE" ] || DOCKERFILE=Dockerfile DOCKERCONTEXT=. if [ -n "$context" ]; then @@ -1892,6 +1894,7 @@ function define_functions_cmd() { function add2dockerfile() { edebug "$(qvals "$@")" + [ -n "${DEFAULTS[build_build]-1}" ] || return [ -n "$DOCKERFILE" ] || return echo "$*" >>"$DOCKERFILE" } @@ -2039,6 +2042,7 @@ function define_functions_cmd() { function cbuild() { edebug "cbuild $(qvals "$@")" + local build="${DEFAULTS[build_build]-1}" local files="${DEFAULTS[cbuild_files]}" local project_name="${DEFAULTS[cbuild_project-name]}" local no_cache="${DEFAULTS[cbuild_no-cache]}" @@ -2057,6 +2061,7 @@ function define_functions_cmd() { shift done + [ -n "$build" ] || return if [ -n "$files" ]; then eval "files=($files)" else @@ -2818,12 +2823,16 @@ function build_action() { action=update_src else action=build - [ -n "$update_src" ] || update_src=1 - [ "$update_src" == no ] && update_src= if [ -z "$clean_update" -a -z "$sync_src" -a -z "$build" -a -z "$push_image" ]; then sync_src=1 build=1 fi + if [ -n "$build" ]; then + [ -n "$update_src" ] || update_src=1 + [ "$update_src" == no ] && update_src= + else + update_src= + fi [ "$sync_src" == no ] && sync_src= fi