runphp: modifier sémantique de --ci
This commit is contained in:
parent
10ce93ffd6
commit
f44d9ef404
@ -2,7 +2,7 @@
|
|||||||
# -*- 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
|
||||||
MYDIR="$(cd "$(dirname -- "$0")"; pwd)"
|
MYDIR="$(cd "$(dirname -- "$0")"; pwd)"
|
||||||
RUNPHP="$MYDIR/runphp"
|
RUNPHP="$MYDIR/runphp"
|
||||||
"$RUNPHP" --bs --ue || exit 1
|
"$RUNPHP" --bs --ue --ci || exit 1
|
||||||
RUNPHP_STANDALONE=
|
RUNPHP_STANDALONE=
|
||||||
PROJDIR=; COMPOSERDIR=; COMPOSERPHAR=; VENDORDIR=; BUILDENV0=; BUILDENV=
|
PROJDIR=; COMPOSERDIR=; COMPOSERPHAR=; VENDORDIR=; BUILDENV0=; BUILDENV=
|
||||||
BUILD_IMAGES=(php-apache mariadb10); export BUILD_FLAVOUR=; DIST=; IMAGENAME=
|
BUILD_IMAGES=(php-apache mariadb10); export BUILD_FLAVOUR=; DIST=; IMAGENAME=
|
||||||
|
@ -219,7 +219,6 @@ function host_check_projdir() {
|
|||||||
install=1
|
install=1
|
||||||
fi
|
fi
|
||||||
if [ -n "$install" ]; then
|
if [ -n "$install" ]; then
|
||||||
eecho "== bootstrapping runphp"
|
|
||||||
[ -n "$Composer" ] || Composer=ci
|
[ -n "$Composer" ] || Composer=ci
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -314,6 +313,7 @@ function host_init_env() {
|
|||||||
|
|
||||||
Chdir=
|
Chdir=
|
||||||
Verbose="$RUNPHP_VERBOSE"
|
Verbose="$RUNPHP_VERBOSE"
|
||||||
|
Exec=
|
||||||
}
|
}
|
||||||
|
|
||||||
function host_docker_build() {
|
function host_docker_build() {
|
||||||
@ -359,7 +359,7 @@ OPTIONS
|
|||||||
paramètres pour la consruction de l'image
|
paramètres pour la consruction de l'image
|
||||||
--ci
|
--ci
|
||||||
--cu
|
--cu
|
||||||
lancer composer install (resp. update) après bootstrap
|
lancer composer install (resp. update) s'il y a eu bootstrap
|
||||||
--no-use-rslave
|
--no-use-rslave
|
||||||
paramètre montage des volumes"
|
paramètre montage des volumes"
|
||||||
exit 0
|
exit 0
|
||||||
@ -404,7 +404,7 @@ OPTIONS
|
|||||||
host_check_image && exists=1 || exists=
|
host_check_image && exists=1 || exists=
|
||||||
|
|
||||||
if [ -z "$UnlessExists" -o -z "$exists" ]; then
|
if [ -z "$UnlessExists" -o -z "$exists" ]; then
|
||||||
eecho "== Building $Image"
|
eecho "== bootstrapping $Image"
|
||||||
args=(
|
args=(
|
||||||
-f "$Dockerfile"
|
-f "$Dockerfile"
|
||||||
${Pull:+--pull}
|
${Pull:+--pull}
|
||||||
@ -428,6 +428,9 @@ OPTIONS
|
|||||||
eecho "== Pushing $Image"
|
eecho "== Pushing $Image"
|
||||||
docker push "$Image" || exit 1
|
docker push "$Image" || exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# s'il n'y a pas eu bootstrap, alors ne pas lancer la commande composer
|
||||||
|
Composer=
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,9 +448,14 @@ function host_docker_run() {
|
|||||||
runphp: lancer une commande dans un environnement PHP déterminé
|
runphp: lancer une commande dans un environnement PHP déterminé
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
|
$MYNAME --bs ...
|
||||||
$MYNAME ci|cu|composer
|
$MYNAME ci|cu|composer
|
||||||
$MYNAME [options] command [args...]
|
$MYNAME [options] command [args...]
|
||||||
|
|
||||||
|
COMMANDES SPECIALES
|
||||||
|
--bs
|
||||||
|
faire un bootstrap de l'image runphp
|
||||||
|
|
||||||
COMMANDES COMPOSER
|
COMMANDES COMPOSER
|
||||||
ci
|
ci
|
||||||
cu
|
cu
|
||||||
@ -529,7 +537,7 @@ OPTIONS
|
|||||||
exec "$0" ${Chdir:+-w "$Chdir"}
|
exec "$0" ${Chdir:+-w "$Chdir"}
|
||||||
)
|
)
|
||||||
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
|
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
|
||||||
docker "${args[@]}" "$@"
|
${Exec:+exec} docker "${args[@]}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function container_exec() {
|
function container_exec() {
|
||||||
@ -605,12 +613,10 @@ if [ "$RUNPHP_MODE" != docker ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${#Cmd[*]} -gt 0 ]; then
|
if [ ${#Cmd[*]} -gt 0 ]; then
|
||||||
host_docker_run "${Cmd[@]}" || exit $?
|
Exec=1 host_docker_run "${Cmd[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
# Lancement depuis l'intérieur du container
|
# Lancement depuis l'intérieur du container
|
||||||
container_exec "$@"
|
container_exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
Loading…
Reference in New Issue
Block a user