corriger runphp

This commit is contained in:
Jephté Clain 2025-02-12 21:11:21 +04:00
parent 6a2e879dc4
commit 3425efbca8
3 changed files with 99 additions and 67 deletions

View File

@ -22,7 +22,7 @@ done
if [ -z "$PROJDIR" ]; then
# s'il n'y a pas de projet, --bs est l'action par défaut
[ $# -gt 0 ] || set -- --bs
[ $# -gt 0 ] || set -- --bs --ue
elif [ "$MYNAME" == composer ]; then
set -- composer "$@"
else

View File

@ -183,7 +183,10 @@ elif [ "$1" == --runphp-exec ]; then
Bootstrap=
shift
elif [ "$1" == --runphp-install -o "$1" == --ci ]; then
ComposerInstall=1
ComposerInstall=ci
shift
elif [ "$1" == --runphp-update -o "$1" == --cu ]; then
ComposerInstall=cu
shift
fi
@ -200,7 +203,7 @@ if [ -z "$Bootstrap" -a -z "$RUNPHP_STANDALONE" ]; then
if [ -n "$ForcedBootstrap" ]; then
[ "$RUNPHP_MODE" != docker ] && eecho "== bootstrapping runphp"
Bootstrap=1
ComposerInstall=1
ComposerInstall=ci
fi
fi
@ -298,7 +301,10 @@ if [ "$RUNPHP_MODE" != docker ]; then
after_source_buildenv
fi
ensure_image
check_image || Bootstrap=1
if ! check_image; then
ForcedBootstrap=1
Bootstrap=1
fi
fi
Chdir=
@ -342,7 +348,7 @@ if [ "$RUNPHP_MODE" != docker ]; then
runphp: construire l'image docker
USAGE
$MYNAME --bootstrap [options...]
$MYNAME --runphp-bootstrap [options...]
OPTIONS
-c, --config build.env
@ -369,7 +375,8 @@ OPTIONS
-z|--timezone) shift; TIMEZONE="$1";;
-r|--privareg) shift; PRIVAREG="$1";;
-p|--push) Push=1;;
--ci) ComposerInstall=1;;
--ci) ComposerInstall=ci;;
--cu) ComposerInstall=cu;;
--no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";;
esac
@ -420,11 +427,19 @@ OPTIONS
fi
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
[ -n "$ComposerInstall" ] || ComposerInstall=ci
fi
[ -z "$ComposerInstall" -o -n "$UnlessExists" ] && exit 0
if [ -n "$ForcedBootstrap" ]; then
# si le bootstrap est forcé, ne continuer que s'il y a des arguments
[ $# -eq 0 ] && exit 0
else
# si le bootstrap a été demandé, ne continuer que s'il faut
# installer les dépendances
[ -z "$ComposerInstall" ] && exit 0
fi
fi
## Mode exécution de commande ##########################################
# Ici, on a déterminé qu'il faut lancer une commande
@ -467,8 +482,7 @@ OPTIONS
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
ComposerInstall=ci
fi
## Lancer la commande
@ -529,7 +543,7 @@ OPTIONS
"$Image"
exec "$0" ${Chdir:+-w "$Chdir"}
)
[ -n "$ComposerInstall" ] && set -- ci
[ -n "$ComposerInstall" ] && set -- "$ComposerInstall" "$@"
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
exec docker "${args[@]}" "$@"
@ -568,10 +582,12 @@ else
die "no command specified"
elif [ "$1" == ci ]; then
eecho "== installing composer dependencies"
composer i
shift
composer i "$@"
elif [ "$1" == cu ]; then
eecho "== upgrading composer dependencies"
composer u
shift
composer u "$@"
elif [ "$1" == composer ]; then
"$@"
else

View File

@ -134,7 +134,10 @@ elif [ "$1" == --runphp-exec ]; then
Bootstrap=
shift
elif [ "$1" == --runphp-install -o "$1" == --ci ]; then
ComposerInstall=1
ComposerInstall=ci
shift
elif [ "$1" == --runphp-update -o "$1" == --cu ]; then
ComposerInstall=cu
shift
fi
@ -151,7 +154,7 @@ if [ -z "$Bootstrap" -a -z "$RUNPHP_STANDALONE" ]; then
if [ -n "$ForcedBootstrap" ]; then
[ "$RUNPHP_MODE" != docker ] && eecho "== bootstrapping runphp"
Bootstrap=1
ComposerInstall=1
ComposerInstall=ci
fi
fi
@ -249,7 +252,10 @@ if [ "$RUNPHP_MODE" != docker ]; then
after_source_buildenv
fi
ensure_image
check_image || Bootstrap=1
if ! check_image; then
ForcedBootstrap=1
Bootstrap=1
fi
fi
Chdir=
@ -293,7 +299,7 @@ if [ "$RUNPHP_MODE" != docker ]; then
runphp: construire l'image docker
USAGE
$MYNAME --bootstrap [options...]
$MYNAME --runphp-bootstrap [options...]
OPTIONS
-c, --config build.env
@ -320,7 +326,8 @@ OPTIONS
-z|--timezone) shift; TIMEZONE="$1";;
-r|--privareg) shift; PRIVAREG="$1";;
-p|--push) Push=1;;
--ci) ComposerInstall=1;;
--ci) ComposerInstall=ci;;
--cu) ComposerInstall=cu;;
--no-use-rslave) UseRslave=;;
*) die "$1: option non configurée";;
esac
@ -371,11 +378,19 @@ OPTIONS
fi
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
[ -n "$ComposerInstall" ] || ComposerInstall=ci
fi
[ -z "$ComposerInstall" -o -n "$UnlessExists" ] && exit 0
if [ -n "$ForcedBootstrap" ]; then
# si le bootstrap est forcé, ne continuer que s'il y a des arguments
[ $# -eq 0 ] && exit 0
else
# si le bootstrap a été demandé, ne continuer que s'il faut
# installer les dépendances
[ -z "$ComposerInstall" ] && exit 0
fi
fi
## Mode exécution de commande ##########################################
# Ici, on a déterminé qu'il faut lancer une commande
@ -418,8 +433,7 @@ OPTIONS
if [ -z "$RUNPHP_STANDALONE" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
# Forcer l'installation des dépendances si nécessaire
ComposerInstall=1
fi
ComposerInstall=ci
fi
## Lancer la commande
@ -480,7 +494,7 @@ OPTIONS
"$Image"
exec "$0" ${Chdir:+-w "$Chdir"}
)
[ -n "$ComposerInstall" ] && set -- ci
[ -n "$ComposerInstall" ] && set -- "$ComposerInstall" "$@"
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
exec docker "${args[@]}" "$@"
@ -519,10 +533,12 @@ else
die "no command specified"
elif [ "$1" == ci ]; then
eecho "== installing composer dependencies"
composer i
shift
composer i "$@"
elif [ "$1" == cu ]; then
eecho "== upgrading composer dependencies"
composer u
shift
composer u "$@"
elif [ "$1" == composer ]; then
"$@"
else