Formatting & add information messages.
This commit is contained in:
parent
5f83e83fc8
commit
03d669750c
@ -56,7 +56,7 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PROJECT_NAME" != "$USER_TARGET_PROJECT" ]; then
|
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
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -63,4 +63,6 @@ CURRENT_REMOTE="$(lxc remote get-default)"
|
|||||||
if ! lxc remote get-default | grep -q "local"; then
|
if ! lxc remote get-default | grep -q "local"; then
|
||||||
lxc remote switch local
|
lxc remote switch local
|
||||||
lxc remote remove "$CURRENT_REMOTE"
|
lxc remote remove "$CURRENT_REMOTE"
|
||||||
|
|
||||||
|
echo "INFO: The remote '$CURRENT_REMOTE' has been removed! You are currenly controlling your local instance."
|
||||||
fi
|
fi
|
@ -3,7 +3,6 @@
|
|||||||
set -eu
|
set -eu
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
|
||||||
# check if there are any uncommited changes. It's dangerous to
|
# check if there are any uncommited changes. It's dangerous to
|
||||||
# alter production systems when you have commits to make or changes to stash.
|
# alter production systems when you have commits to make or changes to stash.
|
||||||
if git update-index --refresh | grep -q "needs update"; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "WARNING: this script backs up your existing remote and saves all data locally in the SSME."
|
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 " 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"
|
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
|
# version of code that was last used
|
||||||
GIT_COMMIT_ON_REMOTE_HOST="$(ssh ubuntu@$BTCPAY_FQDN cat /home/ubuntu/.ss-githead)"
|
GIT_COMMIT_ON_REMOTE_HOST="$(ssh ubuntu@$BTCPAY_FQDN cat /home/ubuntu/.ss-githead)"
|
||||||
cd project/
|
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"
|
git checkout "$GIT_COMMIT_ON_REMOTE_HOST"
|
||||||
cd -
|
cd -
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# run deploy which backups up everything, but doesnt restart any services.
|
# 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"
|
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
|
./destroy.sh
|
||||||
|
|
||||||
cd project/
|
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"
|
git checkout "$TARGET_PROJECT_GIT_COMMIT"
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
sleep 5
|
|
||||||
# Then we can run a restore operation and specify the backup archive at the CLI.
|
# 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"
|
bash -c "./project/deploy.sh -y --restore-www --restore-btcpay --backup-archive-path=$BTCPAY_RESTORE_ARCHIVE_PATH"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user