From c95265817fa0dfbcee291bbd8911d0aa35bab68d Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Wed, 24 Aug 2022 10:09:09 -0400 Subject: [PATCH] Added 'projects' for deployment namespaces. --- cluster.sh | 16 +++-- defaults.sh | 1 + deploy.sh | 101 ++++++++++++++++++++++++++----- deployment/stub_lxc_profile.sh | 4 +- deployment/www/stub_nginxconf.sh | 13 ++-- install.sh | 5 ++ 6 files changed, 108 insertions(+), 32 deletions(-) diff --git a/cluster.sh b/cluster.sh index 056ac34..fcf70be 100755 --- a/cluster.sh +++ b/cluster.sh @@ -38,12 +38,8 @@ if [ "$COMMAND" = create ]; then # Note: the path above ./ corresponds to your LXD Remote. If your remote is set to 'cluster1' # Then $HOME/ss-clusters/cluster1 will be your cluster working path. export LXD_CLUSTER_PASSWORD="$(gpg --gen-random --armor 1 14)" -export SOVEREIGN_STACK_MAC_ADDRESS="CHANGE_ME_REQUIRED- see www.sovereign-stack.org/reservations/" -# This is REQUIRED. A list of all sites in ~/ss-sites/ that will be deployed. -# e.g., 'domain1.tld,domain2.tld,domain3.tld' Add all your domains that will -# run within this SS deployment. -export SITE_LIST="domain1.tld" +export PROJECT_NAME="[public|private1|private2]" # only relevant export REGISTRY_URL="http://$(hostname).$(resolvectl status | grep 'DNS Domain:' | awk '{ print $3 }'):5000" @@ -148,7 +144,7 @@ EOL IP_OF_MGMT_MACHINE="${IP_OF_MGMT_MACHINE#*=}" IP_OF_MGMT_MACHINE="$(echo "$IP_OF_MGMT_MACHINE" | cut -d: -f1)" - # if the LXD_CLUSTER_PASSWORD wasnt set, we can generate a random one using gpg. + # error out if the cluster password is unset. if [ -z "$LXD_CLUSTER_PASSWORD" ]; then echo "ERROR: LXD_CLUSTER_PASSWORD must be set in your cluster_definition." exit 1 @@ -189,7 +185,7 @@ fi fi # stub out the lxd init file for the remote SSH endpoint. - CLUSTER_MASTER_LXD_INIT="$CLUSTER_PATH/$CLUSTER_NAME-lxd_profile.yml" + CLUSTER_MASTER_LXD_INIT="$CLUSTER_PATH/lxdinit_profile.yml" cat >"$CLUSTER_MASTER_LXD_INIT" <"$PROJECT_DEFINITION_PATH" < "$YAML_PATH" < "$NGINX_CONF_PATH" cat >>"$NGINX_CONF_PATH" <> "$HOME/.bashrc" + ADDED_COMMAND=true +fi + if [ "$ADDED_COMMAND" = true ]; then echo "WARNING! You need to run 'source ~/.bashrc' before continuing." fi \ No newline at end of file