aboutsummaryrefslogtreecommitdiffstats
path: root/bin/deploy.sh
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-05 19:11:58 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-05 19:11:58 +0100
commit7f58c9217cdd9fe1ef3f301f2dc9c895382d763f (patch)
tree8581bf4b0ab2b3e2ee449952ca4c487dd26795d6 /bin/deploy.sh
parentd6a4608a4f34f8ba7722b4df2d5ad76d4ab38244 (diff)
build(docker): add help option to print script usage
Diffstat (limited to 'bin/deploy.sh')
-rwxr-xr-xbin/deploy.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/bin/deploy.sh b/bin/deploy.sh
index b843b97..3a01167 100755
--- a/bin/deploy.sh
+++ b/bin/deploy.sh
@@ -15,11 +15,40 @@ loadenvs() {
error() {
printf "Error: stack name not defined.\n"
printf "Usage: sh deploy.sh your-stack-name [OPTIONS]\n"
+ printf "You can display more information about usage with -h or --help.\n"
exit 1
}
+help() {
+ cat <<EOF
+# USAGE
+sh deploy.sh [your-stack-name] [OPTIONS]
+
+# DESCRIPTION
+The version command allows Dotig to print its version and to check for a new release.
+
+# OPTIONS
+If [your-stack-name] is not provided:
+-h, --help Print this help.
+
+If [your-stack-name] is provided:
+--orchestrator string Orchestrator to use (swarm|kubernetes|all)
+--prune Prune services that are no longer referenced
+--resolve-image string Query the registry to resolve image digest and
+ supported platforms
+ ("always"|"changed"|"never") (default "always")
+--with-registry-auth Send registry authentication details to Swarm agents
+
+# BUGS
+If you find any bug, you can report it on https://github.com/ArmandPhilippot/apcom/issues.
+EOF
+
+ exit
+}
+
deploy() {
[ $# -eq 0 ] && error
+ [ "$1" = "-h" ] || [ "$1" = "--help" ] && help
_stack_name="$1"
shift