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 fi
# TODO ensure we are only GROWING the volume--never shrinking per zfs volume docs. # TODO ensure we are only GROWING the volume--never shrinking per zfs volume docs.
VM_ID=
BACKUP_DISK_SIZE_GB= BACKUP_DISK_SIZE_GB=
SSDATA_DISK_SIZE_GB= SSDATA_DISK_SIZE_GB=
DOCKER_DISK_SIZE_GB= DOCKER_DISK_SIZE_GB=
if [ "$VIRTUAL_MACHINE" = www ]; then if [ "$VIRTUAL_MACHINE" = www ]; then
if [ "$SKIP_WWW" = true ]; then if [ "$SKIP_WWW_SERVER" = true ]; then
exit 0 exit 0
fi fi
VM_ID="w"
BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB" BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB" SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB" DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB"
fi fi
if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then if [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
if [ "$SKIP_BTCPAYSERVER" = true ]; then if [ "$SKIP_BTCPAY_SERVER" = true ]; then
exit 0 exit 0
fi 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" BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB" SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB" DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"

View File

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

View File

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