1
1
Fork 1

Nitpicks.

This commit is contained in:
Derek Smith 2023-10-20 13:20:56 -04:00
parent 1c99942bb2
commit 0be4a5a2bd
Signed by: farscapian
GPG Key ID: B443E530A14E1C90
4 changed files with 10 additions and 18 deletions

View File

@ -5,8 +5,6 @@ cd "$(dirname "$0")"
VIRTUAL_MACHINE=base
LXD_HOSTNAME=
SSDATA_VOLUME_NAME=
BACKUP_VOLUME_NAME=
# grab any modifications from the command line.
for i in "$@"; do
@ -19,14 +17,6 @@ for i in "$@"; do
VIRTUAL_MACHINE="${i#*=}"
shift
;;
--ss-volume-name=*)
SSDATA_VOLUME_NAME="${i#*=}"
shift
;;
--backup-volume-name=*)
BACKUP_VOLUME_NAME="${i#*=}"
shift
;;
*)
echo "Unexpected option: $1"
exit 1
@ -82,8 +72,6 @@ EOF
fi
. ./target.sh
# if VIRTUAL_MACHINE=base, then we doing the base image.
if [ "$VIRTUAL_MACHINE" = base ]; then
# this is for the base image only...
@ -144,7 +132,7 @@ EOF
"${REGISTRY_URL}"
],
"labels": [
"PROJECT_COMMIT=${TARGET_PROJECT_GIT_COMMIT}"
"test=test"
]
}
@ -216,6 +204,7 @@ if [ "$VIRTUAL_MACHINE" != base ]; then
match:
macaddress: ${MAC_ADDRESS_TO_PROVISION}
set-name: enp5s0
EOF
fi
@ -252,6 +241,9 @@ devices:
type: disk
EOF
if [ "$VIRTUAL_MACHINE" != base ]; then
cat >> "$YAML_PATH" <<EOF
ss-data:
@ -278,7 +270,7 @@ name: ${FILENAME}
EOF
else
# If we are deploying a VM that attaches to the network underlay.
# If we are deploying a VM that attaches to the network underlay.
cat >> "$YAML_PATH" <<EOF
enp5s0:
nictype: macvlan
@ -286,6 +278,7 @@ else
type: nic
EOF
# on www and btcpayserver, we also attach the VMs to OVN network for inter-VM communication
if [ "$VIRTUAL_MACHINE" = www ] || [ "$VIRTUAL_MACHINE" = btcpayserver ]; then
cat >> "$YAML_PATH" <<EOF
enp6s0:
@ -316,4 +309,3 @@ else
# configure the profile with our generated cloud-init.yml file.
cat "$YAML_PATH" | lxc profile edit "$LXD_HOSTNAME"
fi

View File

@ -324,6 +324,8 @@ export UPDATE_BTCPAY="$UPDATE_BTCPAY"
VPS_HOSTNAME=
. ./base.sh
# first, we create base images if needed.
if ! lxc image list --format csv | grep -q "$DOCKER_BASE_IMAGE_NAME"; then
# create the lxd base image.
if [ "$SKIP_BASE_IMAGE_CREATION" = false ]; then
@ -375,7 +377,6 @@ for VIRTUAL_MACHINE in www btcpayserver lnplayserver; do
DATA_PLANE_MACVLAN_INTERFACE="$(echo "$CONFIG_ITEMS" | cut -d ',' -f2)"
export DATA_PLANE_MACVLAN_INTERFACE="$DATA_PLANE_MACVLAN_INTERFACE"
# Now let's switch to the new project to ensure new resources are created under the project scope.
if ! lxc info | grep "project:" | grep -q "$PROJECT_NAME"; then
lxc project switch "$PROJECT_NAME"

View File

@ -1,6 +1,6 @@
#!/bin/bash
set -e
set -eu
LXC_INSTANCE_NAME=

View File

@ -5,7 +5,6 @@ alias ss-remote='/home/ubuntu/sovereign-stack/deployment/remote.sh $@'
alias ss-up='/home/ubuntu/sovereign-stack/deployment/up.sh $@'
alias ss-down='/home/ubuntu/sovereign-stack/deployment/down.sh $@'
alias ss-reset='/home/ubuntu/sovereign-stack/deployment/reset.sh $@'
alias ss-stop='/home/ubuntu/sovereign-stack/deployment/stop.sh $@'
alias ss-start='/home/ubuntu/sovereign-stack/deployment/start.sh $@'
alias ss-restore='/home/ubuntu/sovereign-stack/deployment/restore.sh $@'