From 55de36dadca66b3e15f1180c2f3b7efb9658347e Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Tue, 4 Apr 2023 16:23:42 -0400 Subject: [PATCH] Imrove deployment reliability. --- btcpayserver/go.sh | 9 +++++++-- www/stub/nginx_yml.sh | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/btcpayserver/go.sh b/btcpayserver/go.sh index 91a3cb9..4f60cf3 100755 --- a/btcpayserver/go.sh +++ b/btcpayserver/go.sh @@ -5,7 +5,12 @@ cd "$(dirname "$0")" export DOCKER_HOST="ssh://ubuntu@$BTCPAY_FQDN" -./stub_btcpay_setup.sh +if [ "$STOP_SERVICES" = true ]; then + # run the update. + ssh "$FQDN" "bash -c $BTCPAY_SERVER_APPPATH/btcpay-down.sh" +else + ./stub_btcpay_setup.sh +fi # we will re-run the btcpayserver provisioning scripts if directed to do so. # if an update does occur, we grab another backup. @@ -16,7 +21,7 @@ if [ "$UPDATE_BTCPAY" = true ]; then # btcpay-update.sh brings services back up, but does not take them down. ssh "$FQDN" "sudo bash -c $BTCPAY_SERVER_APPPATH/btcpay-update.sh" - sleep 20 + sleep 30 elif [ "$RESTORE_BTCPAY" = true ]; then # run the update. diff --git a/www/stub/nginx_yml.sh b/www/stub/nginx_yml.sh index 9259d35..b9d43fa 100755 --- a/www/stub/nginx_yml.sh +++ b/www/stub/nginx_yml.sh @@ -138,6 +138,9 @@ EOL done if [ "$STOP_SERVICES" = false ]; then + # for some reason we need to wait here. See if there's a fix; poll for service readiness? + sleep 3 + docker stack deploy -c "$DOCKER_YAML_PATH" reverse-proxy # iterate over all our domains and create the nginx config file. sleep 3