support des options --wamap et --protect depuis la configuration locale de déploiement

This commit is contained in:
Jephté Clain 2017-04-19 01:00:55 +04:00
parent 3bbabbf811
commit a84775ce48
1 changed files with 16 additions and 4 deletions

20
rtoinst
View File

@ -142,16 +142,28 @@ if [ $# -eq 0 ] || [[ "$1" == -* ]]; then
fi
## Hôtes sur lesquels faire le déploiement
toinst_options=()
if array_isempty hosts && [ -n "$deploy_enable" ]; then
urequire deploy
deploy_setconf "$deploy_confname"
if deploy_loadconf; then
setxx webapp=abspath "$1" // basename --
if eval "$(deploy_query -v host DEST webapp rtoinst_deploy "$deploy_profile" shell "$webapp")"; then
check_interaction -c && einfo "Cette webapp sera déployée vers les hôtes suivants:
if eval "$(deploy_query -v host,wamap,protect DEST webapp rtoinst_deploy "$deploy_profile" shell "$webapp")"; then
msg="Cette webapp sera déployée vers les hôtes suivants:
$(array_to_lines host "" " ")"
if [ -n "$wamap" -o -n "$protect" ]; then
msg="$msg
avec le(s) paramètre(s) suivant(s):"
[ -n "$wamap" ] && msg="$msg
--wamap $(qval "$wamap")"
[ -n "$protect" ] && msg="$msg
--protect $(qval "$protect")"
fi
check_interaction -c && einfo "$msg"
ask_any "Voulez-vous continuer?" Oq || die
array_copy hosts host
[ -n "$wamap" ] && array_add toinst_options --wamap "$wamap"
[ -n "$protect" ] && array_add toinst_options --protect "$protect"
fi
fi
fi
@ -218,7 +230,7 @@ rinteraction=$__interaction
for host in "${hosts[@]}"; do
if [ "$host" == "localhost" ]; then
etitle -s "Déploiement sur l'hôte local"
"$archive" ${tmproot:+--tmproot "$tmproot"} -- "$@"
"$archive" ${tmproot:+--tmproot "$tmproot"} -- "${webapps[@]}" "$@" "${toinst_options[@]}"
eend
else
splituserhost "$host" user host
@ -234,7 +246,7 @@ __estack=$(qval "$__estack")
__tlevel=$(qval "$__tlevel")
export __interaction __estack __tlevel
${UTOOLS_LANG:+UTOOLS_LANG='$UTOOLS_LANG'; export UTOOLS_LANG
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- "${webapps[@]}" "$@")"
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- "${webapps[@]}" "$@" "${toinst_options[@]}")"
eend
fi
done