Simplify and refactor.

This commit is contained in:
Derek Smith 2023-03-05 11:50:22 -05:00
parent 610946e357
commit 8caae387b6
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
6 changed files with 9 additions and 13 deletions

View File

@ -397,10 +397,6 @@ export DOMAIN_COUNT=$(("$(echo "$DOMAIN_LIST" | tr -cd , | wc -c)"+1))
# let's provision our primary domain first.
export DOMAIN_NAME="$PRIMARY_DOMAIN"
# we deploy the WWW and btcpay server under the PRIMARY_DOMAIN.
export DEPLOY_WWW_SERVER=true
export DEPLOY_BTCPAY_SERVER=true
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
export PRIMARY_WWW_FQDN="$WWW_HOSTNAME.$DOMAIN_NAME"
@ -409,7 +405,6 @@ stub_site_definition
# bring the VMs up under the primary domain name.
instantiate_vms
# let's stub out the rest of our site definitions, if any.
for DOMAIN_NAME in ${OTHER_SITES_LIST//,/ }; do
export DOMAIN_NAME="$DOMAIN_NAME"
@ -421,14 +416,14 @@ done
# now let's run the www and btcpay-specific provisioning scripts.
if [ "$SKIP_WWW" = false ] && [ "$DEPLOY_BTCPAY_SERVER" = true ]; then
if [ "$SKIP_WWW" = false ]; then
bash -c "./www/go.sh"
ssh ubuntu@"$PRIMARY_WWW_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead"
fi
export DOMAIN_NAME="$PRIMARY_DOMAIN"
export SITE_PATH="$SITES_PATH/$DOMAIN_NAME"
if [ "$SKIP_BTCPAY" = false ] && [ "$DEPLOY_BTCPAY_SERVER" = true ]; then
if [ "$SKIP_BTCPAY" = false ]; then
./btcpayserver/go.sh
ssh ubuntu@"$BTCPAY_FQDN" "echo $LATEST_GIT_COMMIT > /home/ubuntu/.ss-githead"

View File

@ -22,6 +22,8 @@ fi
. ./cluster_env.sh
. ./project_env.sh
for VM in www btcpayserver; do
LXD_NAME="$VM-${DOMAIN_NAME//./-}"

View File

@ -21,6 +21,8 @@ done
. ./cluster_env.sh
. ./project_env.sh
# Check to see if any of the VMs actually don't exist.
# (we only migrate instantiated vms)
for VM in www btcpayserver; do

View File

@ -159,6 +159,3 @@ fi
# xdg-open "http://$GITEA_FQDN" > /dev/null 2>&1
# fi
# if [ "$DEPLOY_BTCPAY_SERVER" = true ]; then
# xdg-open "http://$BTCPAY_USER_FQDN" > /dev/null 2>&1
# fi

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -exu
set -eu
cd "$(dirname "$0")"
# see https://www.sovereign-stack.org/management/
@ -25,7 +25,7 @@ fi
# install snap
if ! snap list | grep -q lxd; then
sudo snap install lxd --channel=5.10/stable
sleep 3
sleep 5
# run lxd init on the remote server./dev/nvme1n1
#

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -ex
set -e
cd "$(dirname "$0")"
# NOTE! This script MUST be executed as root.