ajout template

This commit is contained in:
Jephté Clain 2024-03-27 20:44:37 +04:00
parent 0673acfc3a
commit 55bcbacb7c
2 changed files with 20 additions and 3 deletions

View File

@ -371,7 +371,7 @@ OPTIONS
gid="$(id -g)"
args=(
run -it --rm
--name rundk
--name "rundk-$(basename -- "$1")-$$"
-e _RUNDK_IN_DOCKER=1
-e _RUNDK_UID="$uid"
-e _RUNDK_GID="$gid"
@ -416,7 +416,7 @@ OPTIONS
args+=(
"$IMAGE"
exec "$MYSELF" ${Chdir:+-w "$Chdir"}
exec "$0" ${Chdir:+-w "$Chdir"}
)
[ -n "$ForcedBootstrap" ] && set -- ci
[ -n "$Verbose" ] && eecho "\$ docker ${args[*]} $*"
@ -472,6 +472,6 @@ else
if [ -n "$chdir" ]; then
cd "$chdir" || exit 1
fi
command "${@:-bash}"
exec "${@:-bash}"
fi
fi

17
support/template.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# -*- 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
MYDIR="$(dirname -- "$0")"; MYNAME="$(basename -- "$0")"
[ -n "$_RUNDK_IN_DOCKER" ] ||
exec "$MYDIR/rundk" --bootstrap --unless-exists --exec -- "$MYDIR/$MYNAME" "$@"
source "$MYDIR/../vendor/nulib/php/load.sh" || exit 1
args=(
"description"
#"usage"
)
parse_args "$@"; set -- "${args[@]}"
echo "je tourne dans un container..."
sleep 1000