From 3ca5d825b580968ec311f97e8018ed4a2120a93e Mon Sep 17 00:00:00 2001 From: Siraj Yasin Date: Wed, 13 Oct 2021 19:30:14 +0000 Subject: [PATCH] Remove .git suffix on repository name * Repository name is extracted from URL and used as WORKDIR. It leads to error when the repository URL is provided with ".git" "https://github.com/airshipit/airshipctl.git" * Remove the ".git suffix when present in repository URL Closes: #653 Change-Id: If154873f4126cedd85aa7f5deac13e17726a732c --- tools/deployment/23_generate_secrets.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/deployment/23_generate_secrets.sh b/tools/deployment/23_generate_secrets.sh index 3d1520c3f..f73ed40e3 100755 --- a/tools/deployment/23_generate_secrets.sh +++ b/tools/deployment/23_generate_secrets.sh @@ -22,7 +22,10 @@ export AIRSHIP_CONFIG_MANIFEST_DIRECTORY=${AIRSHIP_CONFIG_MANIFEST_DIRECTORY:-"/ export AIRSHIP_CONFIG_PHASE_REPO_URL=${AIRSHIP_CONFIG_PHASE_REPO_URL:-"https://review.opendev.org/airship/airshipctl"} export EXTERNAL_KUBECONFIG=${EXTERNAL_KUBECONFIG:-""} export SITE=${SITE:-"test-site"} -export WORKDIR="${AIRSHIP_CONFIG_MANIFEST_DIRECTORY}/$(basename ${AIRSHIP_CONFIG_PHASE_REPO_URL})" +REPO_NAME=$(basename ${AIRSHIP_CONFIG_PHASE_REPO_URL}) +# Remove .git from repository if present +REPO_NAME=${REPO_NAME%.git} +export WORKDIR="${AIRSHIP_CONFIG_MANIFEST_DIRECTORY}/${REPO_NAME}" if [[ -z "$EXTERNAL_KUBECONFIG" ]]; then # we want to take config from bundle - remove kubeconfig file so