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
case "$image" in
rundk)
[ -n "$Config" ] && export RUNDK_FORCE_BUILDENV="$Config"
local -a args=(--bootstrap)
[ -n "$Config" ] && args+=(--config "$Config")
[ -z "$ForceBuild" ] && args+=(--unless-exists)
[ -n "$Pull" ] && args+=(--pull)
[ -n "$NoCache" ] && args+=(--no-cache)
@ -148,9 +148,14 @@ args=(
)
parse_args "$@"; set -- "${args[@]}"
[ -n "$Config" ] && setx Config=abspath "$Config"
build_check_env || die
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
fi
[ "$action" == none ] && exit 0
case "$action" in

View File

@ -185,7 +185,10 @@ if [ -z "$_RUNDK_IN_DOCKER" ]; then
IMAGE=
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
after_source_buildenv
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"
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"
elif [ -n "$BUILDENV0" -a -f "$PROJDIR/$BUILDENV0" ]; then
Config="$PROJDIR/$BUILDENV0"