modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2024-03-27 21:39:01 +04:00
parent 55bcbacb7c
commit a02d25f8d1
2 changed files with 23 additions and 10 deletions

View File

@ -13,7 +13,6 @@
# racine du projet. Le cas échéant, modifier les valeurs ci-dessous # racine du projet. Le cas échéant, modifier les valeurs ci-dessous
MYDIR="$(cd "$(dirname -- "$0")"; pwd)" MYDIR="$(cd "$(dirname -- "$0")"; pwd)"
MYNAME="$(basename -- "$0")" MYNAME="$(basename -- "$0")"
MYSELF="$MYDIR/$MYNAME"
################################################################################ ################################################################################
# Modifier les valeurs suivantes si nécessaire # Modifier les valeurs suivantes si nécessaire
@ -80,16 +79,19 @@ function composer() {
bootstrap= bootstrap=
BootstrapOnly=1 BootstrapOnly=1
ComposerInstall=
ForcedBootstrap= ForcedBootstrap=
parse_opts=1 parse_opts=1
args=() args=()
for arg in "$@"; do for arg in "$@"; do
if [ -z "$parse_opts" ]; then if [ -z "$parse_opts" ]; then
args+=("$arg") args+=("$arg")
elif [ "$arg" == --bootstrap ]; then elif [ "$arg" == --bootstrap -o "$arg" == --bs ]; then
bootstrap=1 bootstrap=1
elif [ "$arg" == --exec ]; then elif [ "$arg" == --exec ]; then
BootstrapOnly= BootstrapOnly=
elif [ "$arg" == --composer-install -o "$arg" == --ci ]; then
ComposerInstall=1
elif [[ "$arg" == -* ]]; then elif [[ "$arg" == -* ]]; then
args+=("$arg") args+=("$arg")
else else
@ -113,7 +115,7 @@ if [ -z "$bootstrap" ]; then
fi fi
if [ -n "$ForcedBootstrap" ]; then if [ -n "$ForcedBootstrap" ]; then
[ -z "$_RUNDK_IN_DOCKER" ] && eecho "== rundk bootstrap is needed" [ -z "$_RUNDK_IN_DOCKER" ] && eecho "== bootstrap rundk is needed"
bootstrap=1 bootstrap=1
BootstrapOnly= BootstrapOnly=
fi fi
@ -220,7 +222,7 @@ if [ -z "$_RUNDK_IN_DOCKER" ]; then
) )
SOPTS=+d:9876543210:c:UjDx:z:r:pw:v SOPTS=+d:9876543210:c:UjDx:z:r:pw:v
LOPTS=help,dist:,d19,d18,d17,d16,d15,d14,d13,d12,d11,d10,config:,unless-exists,pull,no-cache,plain-output,apt-proxy:,timezone:,privareg:,push,chdir:,verbose,no-use-rslave LOPTS=help,dist:,d19,d18,d17,d16,d15,d14,d13,d12,d11,d10,config:,ue,unless-exists,pull,nc,no-cache,po,plain-output,apt-proxy:,timezone:,privareg:,push,chdir:,verbose,no-use-rslave
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=
@ -268,10 +270,10 @@ OPTIONS
-[0-9]) Dist="d1${1#-}";; -[0-9]) Dist="d1${1#-}";;
--d*) Dist="${1#--}";; --d*) Dist="${1#--}";;
-c|--config) shift; Config="$1";; -c|--config) shift; Config="$1";;
--unless-exists) UnlessExists=1;; --ue|--unless-exists) UnlessExists=1;;
-U|--pull) Pull=1;; -U|--pull) Pull=1;;
-j|--no-cache) NoCache=1;; -j|--nc|--no-cache) NoCache=1;;
-D|--plain-output) PlainOutput=1;; -D|--po|--plain-output) PlainOutput=1;;
-x|--apt-proxy) shift; APT_PROXY="$1";; -x|--apt-proxy) shift; APT_PROXY="$1";;
-z|--timezone) shift; TIMEZONE="$1";; -z|--timezone) shift; TIMEZONE="$1";;
-r|--privareg) shift; PRIVAREG="$1";; -r|--privareg) shift; PRIVAREG="$1";;
@ -319,6 +321,10 @@ OPTIONS
docker push "$IMAGE" || exit 1 docker push "$IMAGE" || exit 1
fi fi
fi fi
if [ -n "$ComposerInstall" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
BootstrapOnly=
ForcedBootstrap=1
fi
[ -n "$BootstrapOnly" ] && exit 0 [ -n "$BootstrapOnly" ] && exit 0
else else
@ -363,6 +369,10 @@ OPTIONS
esac esac
shift shift
done done
if [ -n "$ComposerInstall" -a ! -f "$PROJDIR/$VENDORDIR/nulib/php/load.sh" ]; then
ForcedBootstrap=1
fi
fi fi
## Lancer la commande ## Lancer la commande

View File

@ -1,11 +1,14 @@
#!/bin/bash #!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 # -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
# Modèle de script utilisant rundk pour lancer un traitement dans un container # Modèle de script utilisant rundk pour lancer un traitement dans un container
# Ce script est à la racine du projet et rundk se trouve dans sbin/
MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")" MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")"
[ -n "$_RUNDK_IN_DOCKER" ] || if [ -z "$_RUNDK_IN_DOCKER" ]; then
exec "$MYDIR/rundk" --bootstrap --unless-exists --exec -- "$MYDIR/$MYNAME" "$@" "$MYDIR/sbin/rundk" --bs --ue --ci || exit 1
source "$MYDIR/../vendor/nulib/php/load.sh" || exit 1 exec "$MYDIR/sbin/rundk" "$0" "$@"
fi
source "$MYDIR/vendor/nulib/php/load.sh" || exit 1
args=( args=(
"description" "description"