From afcc6b5fecca8851cd27583c7603a0c30c4bb891 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sun, 11 Feb 2024 20:31:27 -0500 Subject: [PATCH] Make LNPLAY server updates. --- deployment/deploy_vm.sh | 5 +++-- deployment/up.sh | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deployment/deploy_vm.sh b/deployment/deploy_vm.sh index 39457a2..e1352c0 100755 --- a/deployment/deploy_vm.sh +++ b/deployment/deploy_vm.sh @@ -80,10 +80,11 @@ if ! incus list --format csv | grep -q "$INCUS_VM_NAME"; then bash -c "./stub_profile.sh --vm=$VIRTUAL_MACHINE --incus-hostname=$INCUS_VM_NAME --ss-volume-name=$SSDATA_VOLUME_NAME --backup-volume-name=$BACKUP_VOLUME_NAME" - if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then + INCUS_LNPLAYSERVER_IMAGE_NAME="lnplayserver-$DOMAIN_NAME" + if ! incus image list -q --format csv | grep -q "$INCUS_LNPLAYSERVER_IMAGE_NAME"; then script -q -c "incus init -q $DOCKER_BASE_IMAGE_NAME $INCUS_VM_NAME --vm --profile=$INCUS_VM_NAME" /dev/null elif [ "$VIRTUAL_MACHINE" = lnplayserver ]; then - script -q -c "incus init -q $INCUS_VM_NAME $INCUS_VM_NAME --vm --profile=$INCUS_VM_NAME" /dev/null + script -q -c "incus init -q $INCUS_LNPLAYSERVER_IMAGE_NAME $INCUS_VM_NAME --vm --profile=$INCUS_VM_NAME" /dev/null fi # let's PIN the HW address for now so we don't exhaust IP diff --git a/deployment/up.sh b/deployment/up.sh index 1e0769a..b8c2703 100755 --- a/deployment/up.sh +++ b/deployment/up.sh @@ -451,17 +451,19 @@ EOL fi - INCUS_VM_NAME="${LNPLAY_SERVER_FQDN//./-}" - if ! incus image list -q --format csv | grep -q "$INCUS_VM_NAME"; then + INCUS_LNPLAYSERVER_IMAGE_NAME="lnplayserver-$DOMAIN_NAME" + if ! incus image list -q --format csv | grep -q "$INCUS_LNPLAYSERVER_IMAGE_NAME"; then # do all the docker image creation steps, but don't run 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 + INCUS_VM_NAME="${LNPLAY_SERVER_FQDN//./-}" + incus stop "$INCUS_VM_NAME" # create the incus image. - incus publish -q --public "$INCUS_VM_NAME" --alias="$INCUS_VM_NAME" --compression none + incus publish -q --public "$INCUS_VM_NAME" --alias="$INCUS_LNPLAYSERVER_IMAGE_NAME" --compression none incus start "$INCUS_VM_NAME" sleep 10 @@ -470,8 +472,6 @@ EOL sleep 3 fi - - # bring up lnplay services. bash -c "./project/lnplay/up.sh -y --lnplay-conf-path=$LNPLAY_ENV_FILE" fi