From 1973ee54f82c799d4965549c38a689a1f654b3c8 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Fri, 9 Feb 2024 11:30:42 -0500 Subject: [PATCH] Wire up lnplayserver deployment correctly. --- deployment/create_base.sh | 7 ++++--- deployment/up.sh | 33 ++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/deployment/create_base.sh b/deployment/create_base.sh index 267de8a..f2dd92d 100755 --- a/deployment/create_base.sh +++ b/deployment/create_base.sh @@ -28,10 +28,9 @@ else if ! incus list --project default | grep -q "$BASE_IMAGE_VM_NAME"; then # the base image is ubuntu:22.04. - incus init -q --profile="$BASE_IMAGE_VM_NAME" "$UBUNTU_BASE_IMAGE_NAME" "$BASE_IMAGE_VM_NAME" --vm --project default + script -q -c "incus init -q --profile=$BASE_IMAGE_VM_NAME $UBUNTU_BASE_IMAGE_NAME $BASE_IMAGE_VM_NAME --vm --project default" /dev/null fi - if incus info "$BASE_IMAGE_VM_NAME" --project default | grep -q "Status: STOPPED"; then # TODO move this sovereign-stack-base construction VM to separate dedicated IP incus config set "$BASE_IMAGE_VM_NAME" --project default @@ -85,7 +84,9 @@ else fi echo "INFO: Publishing '$BASE_IMAGE_VM_NAME' as image '$DOCKER_BASE_IMAGE_NAME'. Please wait." -incus publish --public "$BASE_IMAGE_VM_NAME/$UBUNTU_BASE_IMAGE_NAME" --project default --alias="$DOCKER_BASE_IMAGE_NAME" --compression none +incus publish -q --public "$BASE_IMAGE_VM_NAME/$UBUNTU_BASE_IMAGE_NAME" \ + --project default --alias="$DOCKER_BASE_IMAGE_NAME" \ + --compression none echo "INFO: Success creating the base image. Deleting artifacts from the build process." incus delete -f "$BASE_IMAGE_VM_NAME" --project default diff --git a/deployment/up.sh b/deployment/up.sh index db20a7d..1e0769a 100755 --- a/deployment/up.sh +++ b/deployment/up.sh @@ -52,6 +52,9 @@ USER_SAYS_YES=false WWW_SERVER_MAC_ADDRESS= BTCPAY_SERVER_MAC_ADDRESS= LNPLAY_SERVER_MAC_ADDRESS= +LNPLAY_ENV_PATH= +LNPLAY_VM_EXPIRATION_DATE= +LNPLAY_ORDER_ID= # grab any modifications from the command line. for i in "$@"; do @@ -100,6 +103,18 @@ for i in "$@"; do RUN_CERT_RENEWAL=false shift ;; + --lnplay-env-path=*) + LNPLAY_ENV_PATH="${i#*=}" + shift + ;; + --vm-expiration-date=*) + LNPLAY_VM_EXPIRATION_DATE="${i#*=}" + shift + ;; + --order-id=*) + LNPLAY_ORDER_ID="${i#*=}" + shift + ;; -y) USER_SAYS_YES=true shift @@ -276,6 +291,7 @@ export DOMAIN_NAME="$PRIMARY_DOMAIN" export PRIMARY_DOMAIN="$PRIMARY_DOMAIN" export BITCOIN_CHAIN="$BITCOIN_CHAIN" export SITE_PATH="$SITES_PATH/$DOMAIN_NAME" +export PRIMARY_SITE_PATH="$SITES_PATH/$PRIMARY_DOMAIN" stub_site_definition @@ -419,24 +435,18 @@ if [ "$SKIP_LNPLAY_SERVER" = false ]; then if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then export DOCKER_HOST="ssh://ubuntu@$LNPLAY_SERVER_FQDN" - # set the active env to our LNPLAY_SERVER_FQDN - cat > ./project/lnplay/active_env.txt < "$LNPLAY_ENV_FILE" <