renommer rundk en devuser
This commit is contained in:
parent
2adaaf5d1e
commit
5000baa6a1
12
runphp/build
12
runphp/build
|
@ -59,16 +59,14 @@ function build_check_env() {
|
||||||
template_process_userfiles
|
template_process_userfiles
|
||||||
|
|
||||||
if [ -n "$updated" ]; then
|
if [ -n "$updated" ]; then
|
||||||
setx user=id -un
|
setx userent=getent passwd "$(id -un)"
|
||||||
setx userent=getent passwd "$user"
|
|
||||||
setx userent=qval "$userent"
|
setx userent=qval "$userent"
|
||||||
setx groupent=getent group "$(id -gn)"
|
setx groupent=getent group "$(id -gn)"
|
||||||
setx groupent=qval "$groupent"
|
setx groupent=qval "$groupent"
|
||||||
sed -i "
|
sed -i "
|
||||||
s/^#_RUNDK_/_RUNDK_/
|
/^#DEVUSER_.*=/s/^#//
|
||||||
s/^_RUNDK_USER=.*/_RUNDK_USER=${user//\//\\\/}/
|
/^DEVUSER_USERENT=/s/=.*/=${userent//\//\\\/}/
|
||||||
s/^_RUNDK_USERENT=.*/_RUNDK_USERENT=${userent//\//\\\/}/
|
/^DEVUSER_GROUPENT=/s/=.*/=${groupent//\//\\\/}/
|
||||||
s/^_RUNDK_GROUPENT=.*/_RUNDK_GROUPENT=${groupent//\//\\\/}/
|
|
||||||
" "$PROJDIR/$BUILDENV"
|
" "$PROJDIR/$BUILDENV"
|
||||||
|
|
||||||
enote "IMPORTANT: Veuillez faire le paramétrage en éditant le fichier $BUILDENV
|
enote "IMPORTANT: Veuillez faire le paramétrage en éditant le fichier $BUILDENV
|
||||||
|
@ -126,7 +124,7 @@ function build_images() {
|
||||||
for image in "$@"; do
|
for image in "$@"; do
|
||||||
case "$image" in
|
case "$image" in
|
||||||
runphp)
|
runphp)
|
||||||
[ ${#Configs[*]} -gt 0 ] && export RUNDK_FORCE_BUILDENVS="${Configs[*]}"
|
[ ${#Configs[*]} -gt 0 ] && export RUNPHP_FORCE_BUILDENVS="${Configs[*]}"
|
||||||
local -a args=(--bootstrap)
|
local -a args=(--bootstrap)
|
||||||
[ "$ForceBuild" != all ] && args+=(--unless-exists)
|
[ "$ForceBuild" != all ] && args+=(--unless-exists)
|
||||||
[ -n "$Pull" ] && args+=(--pull)
|
[ -n "$Pull" ] && args+=(--pull)
|
||||||
|
|
|
@ -17,6 +17,5 @@ PRIVAREG=
|
||||||
REGISTRY=pubdocker.univ-reunion.fr
|
REGISTRY=pubdocker.univ-reunion.fr
|
||||||
DIST=d12
|
DIST=d12
|
||||||
IMAGENAME=runphp
|
IMAGENAME=runphp
|
||||||
#_RUNDK_USER=user
|
#DEVUSER_USERENT=user:x:1000:1000:User,,,:/home/user:/bin/bash
|
||||||
#_RUNDK_USERENT=user:x:1000:1000:User,,,:/home/user:/bin/bash
|
#DEVUSER_GROUPENT=user:x:1000:
|
||||||
#_RUNDK_GROUPENT=user:x:1000:
|
|
||||||
|
|
|
@ -104,13 +104,13 @@ if [ -z "$bootstrap" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ForcedBootstrap" ]; then
|
if [ -n "$ForcedBootstrap" ]; then
|
||||||
[ -z "$_RUNDK_IN_DOCKER" ] && eecho "== runphp is needed: bootstrapping"
|
[ -z "$_RUNPHP_IN_DOCKER" ] && eecho "== runphp is needed: bootstrapping"
|
||||||
bootstrap=1
|
bootstrap=1
|
||||||
BootstrapOnly=
|
BootstrapOnly=
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$_RUNDK_IN_DOCKER" ]; then
|
if [ -z "$_RUNPHP_IN_DOCKER" ]; then
|
||||||
############################################################################
|
############################################################################
|
||||||
# Lancement depuis l'extérieur du container
|
# Lancement depuis l'extérieur du container
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ OPTIONS
|
||||||
args=(
|
args=(
|
||||||
run -it --rm
|
run -it --rm
|
||||||
--name "runphp-$(basename -- "$1")-$$"
|
--name "runphp-$(basename -- "$1")-$$"
|
||||||
-e _RUNDK_IN_DOCKER=1
|
-e _RUNPHP_IN_DOCKER=1
|
||||||
)
|
)
|
||||||
for arg in "${!PROXY_VARS[@]}"; do
|
for arg in "${!PROXY_VARS[@]}"; do
|
||||||
args+=(--e "$arg=${PROXY_VARS[$arg]}")
|
args+=(--e "$arg=${PROXY_VARS[$arg]}")
|
||||||
|
@ -427,14 +427,9 @@ OPTIONS
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
# si c'est un utilisateur lambda, il faut monter les informations
|
# si c'est un utilisateur lambda, il faut monter les informations
|
||||||
# nécessaires. composer est déjà monté via $HOME
|
# nécessaires. composer est déjà monté via $HOME
|
||||||
user="$(id -un)"
|
|
||||||
userent="$(getent passwd "$user")"
|
|
||||||
group="$(id -gn)"
|
|
||||||
groupent="$(getent group "$group")"
|
|
||||||
args+=(
|
args+=(
|
||||||
-e _RUNDK_USER="$user"
|
-e DEVUSER_USERENT="$(getent passwd "$(id -un)")"
|
||||||
-e _RUNDK_USERENT="$userent"
|
-e DEVUSER_GROUPENT="$(getent group "$(id -gn)")"
|
||||||
-e _RUNDK_GROUPENT="$groupent"
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -450,11 +445,10 @@ else
|
||||||
############################################################################
|
############################################################################
|
||||||
# Lancement depuis l'intérieur du container
|
# Lancement depuis l'intérieur du container
|
||||||
|
|
||||||
if [ -n "$_RUNDK_USER" ]; then
|
if [ -n "$DEVUSER_USERENT" ]; then
|
||||||
user="$_RUNDK_USER"
|
user="${DEVUSER_USERENT%%:*}"
|
||||||
export _RUNDK_USER=
|
export DEVUSER_USERENT=
|
||||||
export _RUNDK_USERENT=
|
export DEVUSER_GROUPENT=
|
||||||
export _RUNDK_GROUPENT=
|
|
||||||
if in_path su-exec; then
|
if in_path su-exec; then
|
||||||
exec su-exec "$user" "$0" "$@"
|
exec su-exec "$user" "$0" "$@"
|
||||||
else
|
else
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
RUNPHP=sbin/runphp
|
RUNPHP=sbin/runphp
|
||||||
|
|
||||||
MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")"
|
MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")"
|
||||||
if [ -z "$_RUNDK_IN_DOCKER" ]; then
|
if [ -z "$_RUNPHP_IN_DOCKER" ]; then
|
||||||
"$MYDIR/$RUNPHP" --bs --ue --ci || exit 1
|
"$MYDIR/$RUNPHP" --bs --ue --ci || exit 1
|
||||||
exec "$MYDIR/$RUNPHP" "$0" "$@"
|
exec "$MYDIR/$RUNPHP" "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue