Wire up lnplayserver deployment correctly.
This commit is contained in:
parent
17e9398588
commit
1973ee54f8
@ -28,10 +28,9 @@ else
|
|||||||
|
|
||||||
if ! incus list --project default | grep -q "$BASE_IMAGE_VM_NAME"; then
|
if ! incus list --project default | grep -q "$BASE_IMAGE_VM_NAME"; then
|
||||||
# the base image is ubuntu:22.04.
|
# 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
|
fi
|
||||||
|
|
||||||
|
|
||||||
if incus info "$BASE_IMAGE_VM_NAME" --project default | grep -q "Status: STOPPED"; then
|
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
|
# TODO move this sovereign-stack-base construction VM to separate dedicated IP
|
||||||
incus config set "$BASE_IMAGE_VM_NAME" --project default
|
incus config set "$BASE_IMAGE_VM_NAME" --project default
|
||||||
@ -85,7 +84,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "INFO: Publishing '$BASE_IMAGE_VM_NAME' as image '$DOCKER_BASE_IMAGE_NAME'. Please wait."
|
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."
|
echo "INFO: Success creating the base image. Deleting artifacts from the build process."
|
||||||
incus delete -f "$BASE_IMAGE_VM_NAME" --project default
|
incus delete -f "$BASE_IMAGE_VM_NAME" --project default
|
||||||
|
@ -52,6 +52,9 @@ USER_SAYS_YES=false
|
|||||||
WWW_SERVER_MAC_ADDRESS=
|
WWW_SERVER_MAC_ADDRESS=
|
||||||
BTCPAY_SERVER_MAC_ADDRESS=
|
BTCPAY_SERVER_MAC_ADDRESS=
|
||||||
LNPLAY_SERVER_MAC_ADDRESS=
|
LNPLAY_SERVER_MAC_ADDRESS=
|
||||||
|
LNPLAY_ENV_PATH=
|
||||||
|
LNPLAY_VM_EXPIRATION_DATE=
|
||||||
|
LNPLAY_ORDER_ID=
|
||||||
|
|
||||||
# grab any modifications from the command line.
|
# grab any modifications from the command line.
|
||||||
for i in "$@"; do
|
for i in "$@"; do
|
||||||
@ -100,6 +103,18 @@ for i in "$@"; do
|
|||||||
RUN_CERT_RENEWAL=false
|
RUN_CERT_RENEWAL=false
|
||||||
shift
|
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)
|
-y)
|
||||||
USER_SAYS_YES=true
|
USER_SAYS_YES=true
|
||||||
shift
|
shift
|
||||||
@ -276,6 +291,7 @@ export DOMAIN_NAME="$PRIMARY_DOMAIN"
|
|||||||
export PRIMARY_DOMAIN="$PRIMARY_DOMAIN"
|
export PRIMARY_DOMAIN="$PRIMARY_DOMAIN"
|
||||||
export BITCOIN_CHAIN="$BITCOIN_CHAIN"
|
export BITCOIN_CHAIN="$BITCOIN_CHAIN"
|
||||||
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
|
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
|
||||||
|
export PRIMARY_SITE_PATH="$SITES_PATH/$PRIMARY_DOMAIN"
|
||||||
|
|
||||||
stub_site_definition
|
stub_site_definition
|
||||||
|
|
||||||
@ -419,24 +435,18 @@ if [ "$SKIP_LNPLAY_SERVER" = false ]; then
|
|||||||
if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
|
if [ -n "$LNPLAY_SERVER_MAC_ADDRESS" ]; then
|
||||||
export DOCKER_HOST="ssh://ubuntu@$LNPLAY_SERVER_FQDN"
|
export DOCKER_HOST="ssh://ubuntu@$LNPLAY_SERVER_FQDN"
|
||||||
|
|
||||||
# set the active env to our LNPLAY_SERVER_FQDN
|
LNPLAY_ENV_FILE="$PRIMARY_SITE_PATH/$LNPLAY_SERVER_FQDN/lnplay.conf"
|
||||||
cat > ./project/lnplay/active_env.txt <<EOL
|
|
||||||
${LNPLAY_SERVER_FQDN}
|
|
||||||
EOL
|
|
||||||
|
|
||||||
LNPLAY_ENV_FILE=./project/lnplay/environments/"$LNPLAY_SERVER_FQDN"
|
|
||||||
|
|
||||||
if [ ! -f "$LNPLAY_ENV_FILE" ]; then
|
if [ ! -f "$LNPLAY_ENV_FILE" ]; then
|
||||||
# and we have to set our environment file as well.
|
# and we have to set our environment file as well.
|
||||||
cat > "$LNPLAY_ENV_FILE" <<EOL
|
cat > "$LNPLAY_ENV_FILE" <<EOL
|
||||||
DOCKER_HOST=ssh://ubuntu@${LNPLAY_SERVER_FQDN}
|
DOCKER_HOST=ssh://ubuntu@${LNPLAY_SERVER_FQDN}
|
||||||
DOMAIN_NAME=${PRIMARY_DOMAIN}
|
BACKEND_FQDN=lnplay.${PRIMARY_DOMAIN}
|
||||||
|
FRONTEND_FQDN=remote.${PRIMARY_DOMAIN}
|
||||||
ENABLE_TLS=true
|
ENABLE_TLS=true
|
||||||
BTC_CHAIN=${BITCOIN_CHAIN}
|
BTC_CHAIN=${BITCOIN_CHAIN}
|
||||||
CHANNEL_SETUP=none
|
CHANNEL_SETUP=none
|
||||||
LNPLAY_SERVER_PATH=${SITES_PATH}/${PRIMARY_DOMAIN}/lnplayserver
|
LNPLAY_SERVER_PATH=${SITES_PATH}/${PRIMARY_DOMAIN}/lnplayserver
|
||||||
DEPLOY_PRISM_PLUGIN=true
|
DEPLOY_PRISM_PLUGIN=true
|
||||||
NAMES_FILE_PATH
|
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@ -445,7 +455,7 @@ EOL
|
|||||||
if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then
|
if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then
|
||||||
|
|
||||||
# do all the docker image creation steps, but don't run services.
|
# do all the docker image creation steps, but don't run services.
|
||||||
bash -c "./project/lnplay/up.sh -y --no-services"
|
bash -c "./project/lnplay/up.sh -y --no-services --lnplay-conf-path=$LNPLAY_ENV_FILE"
|
||||||
|
|
||||||
# stop the instance so we can get an image yo
|
# stop the instance so we can get an image yo
|
||||||
incus stop "$INCUS_VM_NAME"
|
incus stop "$INCUS_VM_NAME"
|
||||||
@ -457,11 +467,12 @@ EOL
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
bash -c "./wait_for_ip.sh --incus-name=$INCUS_VM_NAME"
|
bash -c "./wait_for_ip.sh --incus-name=$INCUS_VM_NAME"
|
||||||
|
sleep 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# bring up lnplay services.
|
# bring up lnplay services.
|
||||||
bash -c "./project/lnplay/up.sh -y"
|
bash -c "./project/lnplay/up.sh -y --lnplay-conf-path=$LNPLAY_ENV_FILE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user