1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-01-07 04:49:17 +00:00
ctrl/scripts/nats-server/wrapper-docker-compose.sh
2021-10-05 15:51:30 +02:00

29 lines
908 B
Bash
Executable file

#!/bin/bash
# TO USE:
# ./wrapper ./le.crt ./le.key 50222
LE_CRT=$1
LE_KEY=$2
EXPOSED_NATS_PORT=$3
if go run ./steward/scripts/nats-server/generate-nkeys/main.go; then
echo " * succesfully generated nkeys"
else
echo " * failed to generate nkeys"
exit 1
fi
if go run ./steward/scripts/nats-server/create-docker-compose-files/main.go -imageAndVersion=nats-server:2.5.0 -natsConfPath=./nats.conf -leCertPath="$LE_CRT" -leKeyPath="$LE_KEY" -exposedNatsPort="$EXPOSED_NATS_PORT" -templateDir=./steward/scripts/nats-server/create-docker-compose-files/; then
echo " * succesfully generated docker-compose and env.env file"
else
echo " * failed to generate docker-compse and env.env file"
exit 1
fi
if ./steward/scripts/nats-server/generate-nats-conf/generate-nats-conf.sh; then
echo " * succesfully generated nats.conf"
else
echo " * failed to generate nats-conf"
exit 1
fi