From 03d669750c005895e7e77a5959e0c323265e3139 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 17 Mar 2023 11:19:35 -0400 Subject: [PATCH] Formatting & add information messages. --- deployment/destroy.sh | 2 +- deployment/reset.sh | 2 ++ deployment/update.sh | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/deployment/destroy.sh b/deployment/destroy.sh index a99bfdf..8cd762e 100755 --- a/deployment/destroy.sh +++ b/deployment/destroy.sh @@ -56,7 +56,7 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do fi if [ "$PROJECT_NAME" != "$USER_TARGET_PROJECT" ]; then - echo "INFO: Skipping project '$PROJECT_NAME' since the system owner has used the --project switch." + echo "INFO: Skipping project '$PROJECT_NAME' since the system owner has used the --project= switch." exit fi fi diff --git a/deployment/reset.sh b/deployment/reset.sh index 55c3b13..162dfc3 100755 --- a/deployment/reset.sh +++ b/deployment/reset.sh @@ -63,4 +63,6 @@ CURRENT_REMOTE="$(lxc remote get-default)" if ! lxc remote get-default | grep -q "local"; then lxc remote switch local lxc remote remove "$CURRENT_REMOTE" + + echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are currenly controlling your local instance." fi \ No newline at end of file diff --git a/deployment/update.sh b/deployment/update.sh index 1958988..54c1fbb 100755 --- a/deployment/update.sh +++ b/deployment/update.sh @@ -3,7 +3,6 @@ set -eu cd "$(dirname "$0")" - # check if there are any uncommited changes. It's dangerous to # alter production systems when you have commits to make or changes to stash. if git update-index --refresh | grep -q "needs update"; then @@ -11,7 +10,6 @@ if git update-index --refresh | grep -q "needs update"; then exit 1 fi - echo "WARNING: this script backs up your existing remote and saves all data locally in the SSME." echo " Then, all your VMs are destroyed on the remote resulting is destruction of user data." echo " But then we re-create everything using the new codebase, then restore user data to the" @@ -108,9 +106,11 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do # version of code that was last used GIT_COMMIT_ON_REMOTE_HOST="$(ssh ubuntu@$BTCPAY_FQDN cat /home/ubuntu/.ss-githead)" cd project/ + echo "INFO: switch the 'project' repo to commit prior commit '$GIT_COMMIT_ON_REMOTE_HOST'" + echo " This allows Sovereign Stack to can grab a backup using the version of the code" + echo " that was used when the deployment was created." git checkout "$GIT_COMMIT_ON_REMOTE_HOST" cd - - sleep 5 # run deploy which backups up everything, but doesnt restart any services. bash -c "./project/deploy.sh --stop --no-cert-renew --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH" @@ -119,10 +119,11 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do ./destroy.sh cd project/ + echo "INFO: switching the 'project' repo back to the most recent commit '$TARGET_PROJECT_GIT_COMMIT'" + echo " That way new deployments will be instantiated using the latest codebase." git checkout "$TARGET_PROJECT_GIT_COMMIT" cd - - sleep 5 # Then we can run a restore operation and specify the backup archive at the CLI. bash -c "./project/deploy.sh -y --restore-www --restore-btcpay --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH"