From 080a7ff60c2564ebe3f9483c019522546721eb70 Mon Sep 17 00:00:00 2001 From: mwaeckerlin Date: Tue, 26 Sep 2017 13:15:14 +0200 Subject: [PATCH] updated option --help --- deploy.sh | 44 +++++++++++++++++++++++++++++++++++++++++++- update.sh | 9 +++++---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index dc61448..7f4c850 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,47 @@ #!/bin/bash -e +while test $# -gt 0; do + case "$1" in + (-h|--help) cat <&2 + exit 1 + fi + shift +done + for f in $*; do f=${f%.yaml} if ! test -e ${f}.yaml; then @@ -10,5 +52,5 @@ for f in $*; do for d in $(sed -n 's/^ *source: *//p' ${f}.yaml); do test -e $d || mkdir -p $d done - docker stack deploy --compose-file ${f}.yaml ${f} + docker stack deploy --compose-file ${f}.yaml ${##*/f} done diff --git a/update.sh b/update.sh index bda654f..2a22e27 100755 --- a/update.sh +++ b/update.sh @@ -4,20 +4,21 @@ limit='' while test $# -gt 0; do case "$1" in (-h|--help) cat <