diff --git a/dk b/dk index 632786f..bd287f0 100755 --- a/dk +++ b/dk @@ -234,8 +234,11 @@ function auto_down() { fi } +DEFAULT_PROFILE=devel +set_defaults dk + chdir= -profile=devel +profile= args=(+ --help '$exit_with display_help' -d:,--chdir: chdir= @@ -245,10 +248,11 @@ args=(+ ) parse_args "$@"; set -- "${args[@]}" -[ -n "$chdir" ] && { cd "$chdir" || die; } - # construire par défaut [ $# -eq 0 ] && set -- build +[ -n "$profile" ] || profile="$DEFAULT_PROFILE" + +[ -n "$chdir" ] && { cd "$chdir" || die; } while [ $# -gt 0 ]; do [ "$1" == -- ] && { shift; continue; } @@ -261,6 +265,7 @@ while [ $# -gt 0 ]; do while [ $# -gt 0 -a "$1" != -- ]; do args+=("$1"); shift done + enote "Profil $profile" auto_build "${args[@]}" || die ;; s|run|start) @@ -268,9 +273,11 @@ while [ $# -gt 0 ]; do while [ $# -gt 0 -a "$1" != -- ]; do args+=("$1"); shift done + enote "Profil $profile" auto_up "${args[@]}" || die ;; k|stop) + enote "Profil $profile" auto_stop || die ;; 1|up) @@ -278,6 +285,7 @@ while [ $# -gt 0 ]; do while [ $# -gt 0 -a "$1" != -- ]; do args+=("$1"); shift done + enote "Profil $profile" auto_up "${args[@]}" && auto_logs || die ;; l|logs) auto_logs || die;; @@ -293,6 +301,7 @@ while [ $# -gt 0 ]; do while [ $# -gt 0 -a "$1" != -- ]; do args+=("$1"); shift done + enote "Profil $profile" if auto_build; then auto_up "${args[@]}" && auto_logs || die else diff --git a/lib/default/dk b/lib/default/dk new file mode 100644 index 0000000..0923449 --- /dev/null +++ b/lib/default/dk @@ -0,0 +1,4 @@ +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 + +# Profil par défaut +#PROFILE=prod