possibilité de spécifier un fichier d'environnement pour le build

This commit is contained in:
Jephté Clain 2024-05-13 10:51:06 +04:00
parent c8aee44c2a
commit c2408f768f
1 changed files with 5 additions and 1 deletions

View File

@ -107,6 +107,7 @@ function build_images() {
case "$image" in case "$image" in
rundk) rundk)
local -a args=(--bootstrap) local -a args=(--bootstrap)
[ -n "$Config" ] && args+=(--config "$Config")
[ -z "$ForceBuild" ] && args+=(--unless-exists) [ -z "$ForceBuild" ] && args+=(--unless-exists)
[ -n "$Pull" ] && args+=(--pull) [ -n "$Pull" ] && args+=(--pull)
[ -n "$NoCache" ] && args+=(--no-cache) [ -n "$NoCache" ] && args+=(--no-cache)
@ -114,7 +115,8 @@ function build_images() {
;; ;;
*) *)
if [ -z "$sourced" ]; then if [ -z "$sourced" ]; then
source "$PROJDIR/$BUILDENV" [ -n "$Config" ] || Config="$PROJDIR/$BUILDENV"
source "$Config"
after_source_buildenv after_source_buildenv
read -a HOST_MAPPINGS <<<"${HOST_MAPPINGS// read -a HOST_MAPPINGS <<<"${HOST_MAPPINGS//
/ }" / }"
@ -127,6 +129,7 @@ function build_images() {
} }
action=build action=build
Config=
ForceBuild= ForceBuild=
Pull= Pull=
NoCache= NoCache=
@ -136,6 +139,7 @@ args=(
"Construire les images pour DRE" "Construire les images pour DRE"
#"usage" #"usage"
--check-only action=none "++Ne faire que la vérification de l'environnement" --check-only action=none "++Ne faire que la vérification de l'environnement"
-c:,--config:BUILDENV Config= "Spécifier un fichier d'environnement pour le build"
-r,--rebuild ForceBuild=1 "Forcer la (re)construction de l'image" -r,--rebuild ForceBuild=1 "Forcer la (re)construction de l'image"
-U,--pull Pull=1 "++Forcer le re-téléchargement des images dépendantes" -U,--pull Pull=1 "++Forcer le re-téléchargement des images dépendantes"
-j,--no-cache NoCache=1 "++Construire l'image en invalidant le cache" -j,--no-cache NoCache=1 "++Construire l'image en invalidant le cache"