dkbuild: marquer plus d'action comme étant du build

This commit is contained in:
Jephté Clain 2023-10-02 19:31:07 +04:00
parent 4f7bc3f6bf
commit 2803868e16
1 changed files with 11 additions and 2 deletions

13
dkbuild
View File

@ -1834,6 +1834,7 @@ function define_functions_cmd() {
shift shift
done done
[ -n "${DEFAULTS[build_build]-1}" ] || return
[ -n "$output" ] || die "genfile: Vous devez spécifier le fichier en sortie" [ -n "$output" ] || die "genfile: Vous devez spécifier le fichier en sortie"
if [ -n "$context" ]; then if [ -n "$context" ]; then
mkdir -p "$context" || die mkdir -p "$context" || die
@ -1869,6 +1870,7 @@ function define_functions_cmd() {
shift shift
done done
[ -n "${DEFAULTS[build_build]-1}" ] || return
[ -n "$DOCKERFILE" ] || DOCKERFILE=Dockerfile [ -n "$DOCKERFILE" ] || DOCKERFILE=Dockerfile
DOCKERCONTEXT=. DOCKERCONTEXT=.
if [ -n "$context" ]; then if [ -n "$context" ]; then
@ -1892,6 +1894,7 @@ function define_functions_cmd() {
function add2dockerfile() { function add2dockerfile() {
edebug "$(qvals "$@")" edebug "$(qvals "$@")"
[ -n "${DEFAULTS[build_build]-1}" ] || return
[ -n "$DOCKERFILE" ] || return [ -n "$DOCKERFILE" ] || return
echo "$*" >>"$DOCKERFILE" echo "$*" >>"$DOCKERFILE"
} }
@ -2039,6 +2042,7 @@ function define_functions_cmd() {
function cbuild() { function cbuild() {
edebug "cbuild $(qvals "$@")" edebug "cbuild $(qvals "$@")"
local build="${DEFAULTS[build_build]-1}"
local files="${DEFAULTS[cbuild_files]}" local files="${DEFAULTS[cbuild_files]}"
local project_name="${DEFAULTS[cbuild_project-name]}" local project_name="${DEFAULTS[cbuild_project-name]}"
local no_cache="${DEFAULTS[cbuild_no-cache]}" local no_cache="${DEFAULTS[cbuild_no-cache]}"
@ -2057,6 +2061,7 @@ function define_functions_cmd() {
shift shift
done done
[ -n "$build" ] || return
if [ -n "$files" ]; then if [ -n "$files" ]; then
eval "files=($files)" eval "files=($files)"
else else
@ -2818,12 +2823,16 @@ function build_action() {
action=update_src action=update_src
else else
action=build 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 if [ -z "$clean_update" -a -z "$sync_src" -a -z "$build" -a -z "$push_image" ]; then
sync_src=1 sync_src=1
build=1 build=1
fi 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= [ "$sync_src" == no ] && sync_src=
fi fi