Simplifiey and add comments.

This commit is contained in:
Derek Smith 2023-03-10 21:12:24 -05:00
parent 7a705828b7
commit 8590e82411
Signed by: farscapian
GPG Key ID: B443E530A14E1C90

View File

@ -12,20 +12,6 @@ if git update-index --refresh | grep -q "needs update"; then
fi fi
USER_SAYS_YES=false
for i in "$@"; do
case $i in
-y)
USER_SAYS_YES=true
shift
;;
*)
echo "Unexpected option: $1"
;;
esac
done
. ../defaults.sh . ../defaults.sh
. ./remote_env.sh . ./remote_env.sh
@ -63,6 +49,9 @@ source ../defaults.sh
source "$SITE_PATH/site_definition" source "$SITE_PATH/site_definition"
source ./project/domain_env.sh source ./project/domain_env.sh
# now we want to switch the git HEAD of the project subdirectory to the
# 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/
git checkout "$GIT_COMMIT_ON_REMOTE_HOST" git checkout "$GIT_COMMIT_ON_REMOTE_HOST"
@ -73,7 +62,7 @@ sleep 5
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"
# call the destroy script. If user proceed, then user data is DESTROYED! # call the destroy script. If user proceed, then user data is DESTROYED!
USER_SAYS_YES="$USER_SAYS_YES" ./destroy.sh ./destroy.sh
cd project/ cd project/
git checkout "$TARGET_PROJECT_GIT_COMMIT" git checkout "$TARGET_PROJECT_GIT_COMMIT"