diff --git a/deploy/do-deploy b/deploy/do-deploy new file mode 100755 index 0000000000..3c89cc4809 --- /dev/null +++ b/deploy/do-deploy @@ -0,0 +1,69 @@ +#!/bin/env bash + +set -e + +echo "Welcome to Convoy installer" +echo "" + +while true; do + echo "Should we setup a TLS certificate for you using Let's Encrypt?" + echo "Select no if you are using this internally and Convoy will not be reachable from the internet. y/n" + read -p "Answer: " yn + case $yn in + [Yy]* ) export USE_SELF_SIGNED_CERT=0; break ;; + [Nn]* ) export USE_SELF_SIGNED_CERT=1; break ;; + * ) echo "Please answer yes or no." ;; + esac +done + +read -p "Domain: " DOMAIN +export DOMAIN=$DOMAIN +echo "Ok we'll set up certs for https://$DOMAIN" +echo "" + +cd /etc/convoy/ + +# rewrite caddyfile +export TLS_BLOCK="" +if [[ $USE_SELF_SIGNED_CERT -eq 1 ]]; then + echo "Using a self signed certificate as requested" + export TLS_BLOCK="tls internal" +fi + +rm -f Caddyfile +envsubst > Caddyfile < convoy.json +echo "convoy.json ready" +echo "" +echo "" + +echo "Restarting services" + +# Drop Docker +docker-compose down + +# Start Docker +docker-compose up -d + +echo "" +echo "⌛️ Convoy looks up!" +echo "" +echo "🎉🎉🎉 Done! 🎉🎉🎉" +echo "" +echo "To stop the stack run 'docker-compose stop'" +echo "To start the stack again run 'docker-compose start'"