1
1

SKIP proj provis if is DEPLOYMENT_STRING is null

This commit is contained in:
Derek Smith 2023-09-14 09:48:55 -04:00
parent f8d6d2acfc
commit 8780f9e908
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
2 changed files with 47 additions and 44 deletions

View File

@ -40,8 +40,11 @@ fi
source "$REMOTE_DEFINITION" source "$REMOTE_DEFINITION"
# ensure our projects are provisioned according to DEPLOYMENT_STRING # let's provision the projects if specified in the remote.conf file.
for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do # we assume projects are created EXTERNALLY to sovereign-stack when DEPLOYMENT_STRING is null.
if [ -n "$DEPLOYMENT_STRING" ]; then
# ensure our projects are provisioned according to DEPLOYMENT_STRING
for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
NO_PARENS="${PROJECT_CHAIN:1:${#PROJECT_CHAIN}-2}" NO_PARENS="${PROJECT_CHAIN:1:${#PROJECT_CHAIN}-2}"
PROJECT_PREFIX=$(echo "$NO_PARENS" | cut -d'|' -f1) PROJECT_PREFIX=$(echo "$NO_PARENS" | cut -d'|' -f1)
BITCOIN_CHAIN=$(echo "$NO_PARENS" | cut -d'|' -f2) BITCOIN_CHAIN=$(echo "$NO_PARENS" | cut -d'|' -f2)
@ -53,9 +56,11 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
lxc project set "$PROJECT_NAME" features.networks=true features.images=false features.storage.volumes=true lxc project set "$PROJECT_NAME" features.networks=true features.images=false features.storage.volumes=true
lxc project switch "$PROJECT_NAME" lxc project switch "$PROJECT_NAME"
fi fi
done
fi
# default values are already at regtest mode. # default values are already at regtest mode.
if [ "$BITCOIN_CHAIN" = testnet ]; then if [ "$BITCOIN_CHAIN" = testnet ]; then
WWW_SSDATA_DISK_SIZE_GB=30 WWW_SSDATA_DISK_SIZE_GB=30
WWW_BACKUP_DISK_SIZE_GB=30 WWW_BACKUP_DISK_SIZE_GB=30
@ -69,7 +74,7 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20 LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20
LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=20 LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=20
elif [ "$BITCOIN_CHAIN" = mainnet ]; then elif [ "$BITCOIN_CHAIN" = mainnet ]; then
WWW_SSDATA_DISK_SIZE_GB=40 WWW_SSDATA_DISK_SIZE_GB=40
WWW_BACKUP_DISK_SIZE_GB=40 WWW_BACKUP_DISK_SIZE_GB=40
@ -83,14 +88,12 @@ for PROJECT_CHAIN in ${DEPLOYMENT_STRING//,/ }; do
LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20 LNPLAY_SERVER_BACKUP_DISK_SIZE_GB=20
LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=400 LNPLAY_SSERVER_DOCKER_DISK_SIZE_GB=400
fi fi
export WWW_SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB" export WWW_SSDATA_DISK_SIZE_GB="$WWW_SSDATA_DISK_SIZE_GB"
export WWW_BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB" export WWW_BACKUP_DISK_SIZE_GB="$WWW_BACKUP_DISK_SIZE_GB"
export WWW_DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB" export WWW_DOCKER_DISK_SIZE_GB="$WWW_DOCKER_DISK_SIZE_GB"
export BTCPAYSERVER_SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB" export BTCPAYSERVER_SSDATA_DISK_SIZE_GB="$BTCPAYSERVER_SSDATA_DISK_SIZE_GB"
export BTCPAYSERVER_BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB" export BTCPAYSERVER_BACKUP_DISK_SIZE_GB="$BTCPAYSERVER_BACKUP_DISK_SIZE_GB"
export BTCPAYSERVER_DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB" export BTCPAYSERVER_DOCKER_DISK_SIZE_GB="$BTCPAYSERVER_DOCKER_DISK_SIZE_GB"
done

View File

@ -153,7 +153,7 @@ fi
export REMOTE_DEFINITION="$REMOTE_DEFINITION" export REMOTE_DEFINITION="$REMOTE_DEFINITION"
source "$REMOTE_DEFINITION" source "$REMOTE_DEFINITION"
export LXD_REMOTE_PASSWORD="$LXD_REMOTE_PASSWORD" export LXD_REMOTE_PASSWORD="$LXD_REMOTE_PASSWORD"
export DEPLOYMENT_STRING="$DEPLOYMENT_STRING"
# this is our password generation mechanism. Relying on GPG for secure password generation # this is our password generation mechanism. Relying on GPG for secure password generation
function new_pass { function new_pass {