From 12d4828d18b7a78480f0c2d94af84d18bc3aaede Mon Sep 17 00:00:00 2001 From: James Gu Date: Mon, 12 Apr 2021 10:12:31 -0700 Subject: [PATCH] Set repo url in generate secret script Set the repo url in the generate secret script in the case that the user's project and site were created outside of the treasuremap repo. Signed-off-by: James Gu Change-Id: Ie5a80b5df4f0ab33617d72daf75685b06cb2b407 --- tools/deployment/23_generate_secrets.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/deployment/23_generate_secrets.sh b/tools/deployment/23_generate_secrets.sh index a01e7b93b..e9084956a 100755 --- a/tools/deployment/23_generate_secrets.sh +++ b/tools/deployment/23_generate_secrets.sh @@ -23,7 +23,13 @@ export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"treasuremap export AIRSHIP_CONFIG_MANIFEST_DIRECTORY=${AIRSHIP_CONFIG_MANIFEST_DIRECTORY:-"/tmp/treasuremap"} # Primary repo options -export AIRSHIP_CONFIG_PHASE_REPO_URL=${AIRSHIP_CONFIG_PHASE_REPO_URL:-"https://review.opendev.org/airship/treasuremap"} +# Only the last item in the repo url path, e.g., 'treasuremap', is used by +# the generate secret command. +# In the case the init_site script was used to generate the project and site +# directory outside of treasuremap, set it to the PROJECT value so we don't +# need to ask the user to set the repo url. +export PROJECT=${PROJECT:-"treasuremap"} +export AIRSHIP_CONFIG_PHASE_REPO_URL=${AIRSHIP_CONFIG_PHASE_REPO_URL:-$PROJECT} cd ${AIRSHIPCTL_PROJECT} ./tools/deployment/23_generate_secrets.sh