From 34c1edf27e4ba3161d892824e756dd0cae10ad3f Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Mon, 13 Mar 2023 13:54:47 -0400 Subject: [PATCH] Add project context switch during ss-update. --- defaults.sh | 2 +- deployment/project_env.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/defaults.sh b/defaults.sh index 93da54c..70ceda7 100755 --- a/defaults.sh +++ b/defaults.sh @@ -101,4 +101,4 @@ export PRIMARY_DOMAIN= # this is the git commit of the project/ sub git repo. # used in the migration script to switch into past for backup # then back to present (TARGET_PROJECT_GIT_COMMIT) for restore. -export TARGET_PROJECT_GIT_COMMIT=c042ff404f02d3fc1739b325660411c68e3bf0b3 +export TARGET_PROJECT_GIT_COMMIT=5e8cc9cee0555bd8736a3116cfa091c88030abba diff --git a/deployment/project_env.sh b/deployment/project_env.sh index d3cc325..0dacd48 100755 --- a/deployment/project_env.sh +++ b/deployment/project_env.sh @@ -30,4 +30,10 @@ if [ -z "$PRIMARY_DOMAIN" ]; then exit 1 fi -source "$PRIMARY_SITE_DEFINITION_PATH" \ No newline at end of file +source "$PRIMARY_SITE_DEFINITION_PATH" + +if ! lxc info | grep "project:" | grep -q "$PROJECT_NAME"; then + if lxc project list | grep -q "$PROJECT_NAME"; then + lxc project switch "$PROJECT_NAME" + fi +fi \ No newline at end of file