diff --git a/dk b/dk index a7e67cb..cfc5343 100755 --- a/dk +++ b/dk @@ -280,9 +280,21 @@ function auto_down() { DEFAULT_PROFILE=devel PROFILE= +DM_PROFILES=() set_defaults dk export PROFILE +if progexists docker-machine; then + setx active_dm=docker-machine active + for dm_profile in "${DM_PROFILES[@]}"; do + splitpair "$dm_profile" dm profile + if [ "$dm" == "$active_dm" ]; then + DEFAULT_PROFILE="$profile" + break + fi + done +fi + chdir= args=( --help '$exit_with display_help' diff --git a/lib/default/dk b/lib/default/dk index 0923449..39be464 100644 --- a/lib/default/dk +++ b/lib/default/dk @@ -2,3 +2,6 @@ # Profil par défaut #PROFILE=prod + +# Profiles pour docker-machine +#DM_PROFILES=(name:profile...)