1
1

Fix Server SKIP flags.

This commit is contained in:
Derek Smith 2023-12-14 12:47:16 -05:00
parent 9d7d08b0ed
commit 50d65ebe7c
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
3 changed files with 27 additions and 38 deletions

View File

@ -31,38 +31,24 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then
fi
# TODO ensure we are only GROWING the volume--never shrinking per zfs volume docs.
VM_ID=
BACKUP_DISK_SIZE_GB=
SSDATA_DISK_SIZE_GB=
DOCKER_DISK_SIZE_GB=
if [ "$VIRTUAL_MACHINE" = www ]; then
if [ "$SKIP_WWW" = true ]; then
if [ "$SKIP_WWW_SERVER" = true ]; then
exit 0
fi
VM_ID="w"
BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB"
fi
if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
if [ "$SKIP_BTCPAYSERVER" = true ]; then
if [ "$SKIP_BTCPAY_SERVER" = true ]; then
exit 0
fi
VM_ID="b"
BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
fi
if [ "$VIRTUAL_MACHINE" = lnplayserver ]; then
if [ "$SKIP_LNPLAY_SERVER" = true ]; then
exit 0
fi
VM_ID="c"
BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"

View File

@ -12,8 +12,8 @@ fi
KEEP_DOCKER_VOLUME=true
OTHER_SITES_LIST=
SKIP_BTCPAYSERVER=false
SKIP_WWW=false
SKIP_BTCPAY_SERVER=false
SKIP_WWW_SERVER=false
SKIP_LNPLAY_SERVER=false
BACKUP_WWW_APPS=true
@ -25,11 +25,11 @@ for i in "$@"; do
shift
;;
--skip-btcpayserver)
SKIP_BTCPAYSERVER=true
SKIP_BTCPAY_SERVER=true
shift
;;
--skip-wwwserver)
SKIP_WWW=true
SKIP_WWW_SERVER=true
shift
;;
--skip-lnplayserver)
@ -44,11 +44,11 @@ for i in "$@"; do
done
SERVERS=
if [ "$SKIP_BTCPAYSERVER" = false ]; then
if [ "$SKIP_BTCPAY_SERVER" = false ]; then
SERVERS="btcpayserver"
fi
if [ "$SKIP_WWW" = false ]; then
if [ "$SKIP_WWW_SERVER" = false ]; then
SERVERS="www $SERVERS"
fi

View File

@ -42,8 +42,8 @@ RESTORE_WWW=false
RESTORE_CERTS=false
BACKUP_CERTS=true
BACKUP_BTCPAY=true
SKIP_BTCPAYSERVER=false
SKIP_WWW=false
SKIP_BTCPAY_SERVER=false
SKIP_WWW_SERVER=false
SKIP_LNPLAY_SERVER=false
BACKUP_BTCPAY_ARCHIVE_PATH=
RESTORE_BTCPAY=false
@ -71,11 +71,11 @@ for i in "$@"; do
shift
;;
--skip-btcpayserver)
SKIP_BTCPAYSERVER=true
SKIP_BTCPAY_SERVER=true
shift
;;
--skip-wwwserver)
SKIP_WWW=true
SKIP_WWW_SERVER=true
shift
;;
--skip-lnplayserver)
@ -293,21 +293,24 @@ if ! incus image list --format csv | grep -q "$DOCKER_BASE_IMAGE_NAME"; then
fi
fi
for VIRTUAL_MACHINE in www btcpayserver lnplayserver; do
if [ "$VIRTUAL_MACHINE" = btcpayserver ] && [ -z "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
continue
fi
VMS_TO_PROVISION=""
if [ -n "$WWW_SERVER_MAC_ADDRESS" ] && [ "$SKIP_WWW_SERVER" = false ]; then
VMS_TO_PROVISION="www"
fi
if [ "$VIRTUAL_MACHINE" = lnplayserver ] && [ -z "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
continue
fi
if [ -n "$BTCPAY_SERVER_MAC_ADDRESS" ] && [ "$SKIP_BTCPAY_SERVER" = false ]; then
VMS_TO_PROVISION="$VMS_TO_PROVISION btcpayserver"
fi
if [ "$VIRTUAL_MACHINE" = www ] && [ -z "$WWW_SERVER_MAC_ADDRESS" ]; then
continue
fi
if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ] || [ "$SKIP_LNPLAY_SERVER" = false ]; then
VMS_TO_PROVISION="$VMS_TO_PROVISION lnplayserver"
fi
for VIRTUAL_MACHINE in $VMS_TO_PROVISION; do
export VIRTUAL_MACHINE="$VIRTUAL_MACHINE"
FQDN=
@ -392,14 +395,14 @@ for DOMAIN_NAME in ${OTHER_SITES_LIST//,/ }; do
stub_site_definition
done
if [ "$SKIP_BTCPAYSERVER" = false ]; then
if [ "$SKIP_BTCPAY_SERVER" = false ]; then
if [ -n "$BTCPAY_SERVER_MAC_ADDRESS" ]; then
export DOCKER_HOST="ssh://ubuntu@$BTCPAY_SERVER_FQDN"
./project/btcpayserver/go.sh
fi
fi
if [ "$SKIP_WWW" = false ]; then
if [ "$SKIP_WWW_SERVER" = false ]; then
# now let's run the www and btcpay-specific provisioning scripts.
if [ -n "$WWW_SERVER_MAC_ADDRESS" ]; then
export DOCKER_HOST="ssh://ubuntu@$WWW_FQDN"