ss-deploy CLI updates.

This commit is contained in:
Derek Smith 2023-04-04 10:54:31 -04:00
parent 68b786aaa2
commit 078ba9ac35
Signed by: farscapian
GPG Key ID: B443E530A14E1C90

View File

@ -39,14 +39,13 @@ RUN_CERT_RENEWAL=true
SKIP_WWW=false SKIP_WWW=false
RESTORE_WWW=false RESTORE_WWW=false
RESTORE_CERTS=false RESTORE_CERTS=false
BACKUP_CERTS=true BACKUP_CERTS=false
BACKUP_APPS=true BACKUP_APPS=false
BACKUP_BTCPAY=true BACKUP_BTCPAY=false
BACKUP_BTCPAY_ARCHIVE_PATH= BACKUP_BTCPAY_ARCHIVE_PATH=
RESTORE_BTCPAY=false RESTORE_BTCPAY=false
SKIP_BTCPAY=false SKIP_BTCPAY=false
UPDATE_BTCPAY=false UPDATE_BTCPAY=false
RECONFIGURE_BTCPAY_SERVER=false
REMOTE_NAME="$(lxc remote get-default)" REMOTE_NAME="$(lxc remote get-default)"
STOP_SERVICES=false STOP_SERVICES=false
USER_SAYS_YES=false USER_SAYS_YES=false
@ -74,28 +73,24 @@ for i in "$@"; do
RUN_CERT_RENEWAL=false RUN_CERT_RENEWAL=false
shift shift
;; ;;
--no-backup-www) --backup-www)
BACKUP_CERTS=false BACKUP_CERTS=true
BACKUP_APPS=false BACKUP_APPS=true
shift
;;
--backup-btcpayserver)
BACKUP_BTCPAY=true
shift shift
;; ;;
--stop) --stop)
STOP_SERVICES=true STOP_SERVICES=true
RESTART_FRONT_END=true RESTART_FRONT_END=false
shift
;;
--restart-front-end)
RESTART_FRONT_END=true
shift shift
;; ;;
--backup-archive-path=*) --backup-archive-path=*)
BACKUP_BTCPAY_ARCHIVE_PATH="${i#*=}" BACKUP_BTCPAY_ARCHIVE_PATH="${i#*=}"
shift shift
;; ;;
--project=*)
USER_TARGET_PROJECT="${i#*=}"
shift
;;
--update-btcpay) --update-btcpay)
UPDATE_BTCPAY=true UPDATE_BTCPAY=true
shift shift
@ -104,7 +99,7 @@ for i in "$@"; do
SKIP_WWW=true SKIP_WWW=true
shift shift
;; ;;
--skip-btcpay) --skip-btcpayserver)
SKIP_BTCPAY=true SKIP_BTCPAY=true
shift shift
;; ;;
@ -112,10 +107,6 @@ for i in "$@"; do
RUN_CERT_RENEWAL=false RUN_CERT_RENEWAL=false
shift shift
;; ;;
--reconfigure-btcpay)
RECONFIGURE_BTCPAY_SERVER=true
shift
;;
-y) -y)
USER_SAYS_YES=true USER_SAYS_YES=true
shift shift
@ -127,6 +118,7 @@ for i in "$@"; do
esac esac
done done
if [ "$RESTORE_BTCPAY" = true ] && [ -z "$BACKUP_BTCPAY_ARCHIVE_PATH" ]; then if [ "$RESTORE_BTCPAY" = true ] && [ -z "$BACKUP_BTCPAY_ARCHIVE_PATH" ]; then
echo "ERROR: Use the '--backup-archive-path=/path/to/btcpay/archive.tar.gz' option when restoring btcpay server." echo "ERROR: Use the '--backup-archive-path=/path/to/btcpay/archive.tar.gz' option when restoring btcpay server."
exit 1 exit 1
@ -424,6 +416,8 @@ done
if [ "$SKIP_WWW" = false ]; then if [ "$SKIP_WWW" = false ]; then
./www/go.sh ./www/go.sh
ssh ubuntu@"$PRIMARY_WWW_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead" ssh ubuntu@"$PRIMARY_WWW_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead"
else
echo "INFO: Skipping www VM."
fi fi
export DOMAIN_NAME="$PRIMARY_DOMAIN" export DOMAIN_NAME="$PRIMARY_DOMAIN"
@ -432,4 +426,6 @@ if [ "$SKIP_BTCPAY" = false ]; then
./btcpayserver/go.sh ./btcpayserver/go.sh
ssh ubuntu@"$BTCPAY_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead" ssh ubuntu@"$BTCPAY_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead"
else
echo "INFO: Skipping the btcpayserver VM."
fi fi