rundk tient compte de $RUNDK_FORCE_BUILDENV

This commit is contained in:
Jephté Clain 2024-05-13 11:45:44 +04:00
parent 5e095a5579
commit a78d93e510
2 changed files with 16 additions and 6 deletions

View File

@ -106,8 +106,8 @@ function build_images() {
for image in "$@"; do for image in "$@"; do
case "$image" in case "$image" in
rundk) rundk)
[ -n "$Config" ] && export RUNDK_FORCE_BUILDENV="$Config"
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)
@ -148,9 +148,14 @@ args=(
) )
parse_args "$@"; set -- "${args[@]}" parse_args "$@"; set -- "${args[@]}"
[ -n "$Config" ] && setx Config=abspath "$Config" if [ -n "$Config" ]; then
setx Config=abspath "$Config"
# pas de vérification d'environnement si on spécifie Config
# ne pas oublier d'implémenter un traitement spécifique si build_check_env()
# contient d'autres vérifications
else
build_check_env || die build_check_env || die
fi
[ "$action" == none ] && exit 0 [ "$action" == none ] && exit 0
case "$action" in case "$action" in

View File

@ -185,7 +185,10 @@ if [ -z "$_RUNDK_IN_DOCKER" ]; then
IMAGE= IMAGE=
if [ -z "$bootstrap" ]; then if [ -z "$bootstrap" ]; then
if [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then if [ -n "$RUNDK_FORCE_BUILDENV" ]; then
source "$RUNDK_FORCE_BUILDENV" || exit 1
after_source_buildenv
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
source "$PROJDIR/$BUILDENV" || exit 1 source "$PROJDIR/$BUILDENV" || exit 1
after_source_buildenv after_source_buildenv
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
@ -215,7 +218,9 @@ if [ -z "$_RUNDK_IN_DOCKER" ]; then
args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args" args="$(getopt -n "$MYNAME" -o "$SOPTS" -l "$LOPTS" -- "$@")" || exit 1; eval "set -- $args"
Dist= Dist=
if [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then if [ -n "$RUNDK_FORCE_BUILDENV" ]; then
Config="$RUNDK_FORCE_BUILDENV"
elif [ -n "$BUILDENV" -a -f "$PROJDIR/$BUILDENV" ]; then
Config="$PROJDIR/$BUILDENV" Config="$PROJDIR/$BUILDENV"
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
Config="$PROJDIR/$BUILDENV0" Config="$PROJDIR/$BUILDENV0"