From efeb0261bcd46224b4847309b7e19c4fa0f62a29 Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 11 Mar 2023 11:12:19 -0500 Subject: [PATCH] Minor updates. --- deployment/.gitignore | 2 +- deployment/destroy.sh | 2 +- deployment/project_env.sh | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/deployment/.gitignore b/deployment/.gitignore index fe7ff13..e3f094e 100644 --- a/deployment/.gitignore +++ b/deployment/.gitignore @@ -1 +1 @@ -#project/ \ No newline at end of file +project \ No newline at end of file diff --git a/deployment/destroy.sh b/deployment/destroy.sh index 79f1597..0be2275 100755 --- a/deployment/destroy.sh +++ b/deployment/destroy.sh @@ -2,8 +2,8 @@ set -e cd "$(dirname "$0")" -# this script takes down all resources in the remote. This script is DESTRUCTIVE of data, so make sure it's backed up first. +# this script destroys all resources in the current project. if lxc remote get-default | grep -q "local"; then echo "ERROR: you are on the local lxc remote. Nothing to destroy" diff --git a/deployment/project_env.sh b/deployment/project_env.sh index 97ec04c..7a5e776 100755 --- a/deployment/project_env.sh +++ b/deployment/project_env.sh @@ -17,9 +17,15 @@ fi source "$PROJECT_DEFINITION_PATH" export PRIMARY_SITE_DEFINITION_PATH="$SITES_PATH/$PRIMARY_DOMAIN/site_definition" -source "$PRIMARY_SITE_DEFINITION_PATH" + +if [ ! -f "$PRIMARY_SITE_DEFINITION_PATH" ]; then + echo "ERROR: the site definition does not exist." + exit 1 +fi if [ -z "$PRIMARY_DOMAIN" ]; then echo "ERROR: The PRIMARY_DOMAIN is not specified. Check your remote definition at '$PRIMARY_SITE_DEFINITION_PATH'." exit 1 fi + +source "$PRIMARY_SITE_DEFINITION_PATH" \ No newline at end of file