From 68de36869811322c646efe8f194ffdd749205fa3 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Thu, 25 Apr 2024 16:32:40 +1000 Subject: [PATCH] Fixed SSH setup in scripts. --- scripts/drevops/deploy-artifact.sh | 2 +- scripts/drevops/deploy-lagoon.sh | 2 +- scripts/drevops/download-db-lagoon.sh | 2 +- scripts/drevops/mirror-code.sh | 2 +- scripts/drevops/task-custom-lagoon.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/drevops/deploy-artifact.sh b/scripts/drevops/deploy-artifact.sh index f37f683f7..c3b411a51 100755 --- a/scripts/drevops/deploy-artifact.sh +++ b/scripts/drevops/deploy-artifact.sh @@ -75,7 +75,7 @@ info "Started ARTIFACT deployment." [ "$(git config --global user.name)" = "" ] && note "Configuring global git user name." && git config --global user.name "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_NAME}" [ "$(git config --global user.email)" = "" ] && note "Configuring global git user email." && git config --global user.email "${DREVOPS_DEPLOY_ARTIFACT_GIT_USER_EMAIL}" -DREVOPS_SSH_PREFIX="DEPLOY" ./scripts/drevops/setup-ssh.sh +export DREVOPS_SSH_PREFIX="DEPLOY" && . ./scripts/drevops/setup-ssh.sh note "Installing artifact builder." composer global require --dev -n --ansi --prefer-source --ignore-platform-reqs drevops/git-artifact:^0.7 diff --git a/scripts/drevops/deploy-lagoon.sh b/scripts/drevops/deploy-lagoon.sh index 0ec321259..6b30af187 100755 --- a/scripts/drevops/deploy-lagoon.sh +++ b/scripts/drevops/deploy-lagoon.sh @@ -83,7 +83,7 @@ info "Started LAGOON deployment." [ -z "${LAGOON_PROJECT}" ] && fail "Missing required value for LAGOON_PROJECT." && exit 1 { [ -z "${DREVOPS_DEPLOY_BRANCH}" ] && [ -z "${DREVOPS_DEPLOY_PR}" ]; } && fail "Missing required value for DREVOPS_DEPLOY_BRANCH or DREVOPS_DEPLOY_PR." && exit 1 -DREVOPS_SSH_PREFIX="DEPLOY" ./scripts/drevops/setup-ssh.sh +export DREVOPS_SSH_PREFIX="DEPLOY" && . ./scripts/drevops/setup-ssh.sh if ! command -v lagoon >/dev/null || [ -n "${DREVOPS_LAGOONCLI_FORCE_INSTALL}" ]; then note "Installing Lagoon CLI." diff --git a/scripts/drevops/download-db-lagoon.sh b/scripts/drevops/download-db-lagoon.sh index c071cca51..eebcb50c7 100755 --- a/scripts/drevops/download-db-lagoon.sh +++ b/scripts/drevops/download-db-lagoon.sh @@ -91,7 +91,7 @@ if [ -f ".env.local" ]; then t=$(mktemp) && export -p >"${t}" && set -a && . ".env.local" && set +a && . "${t}" && rm "${t}" && unset t fi -DREVOPS_SSH_PREFIX="DB_DOWNLOAD" ./scripts/drevops/setup-ssh.sh +export DREVOPS_SSH_PREFIX="DB_DOWNLOAD" && . ./scripts/drevops/setup-ssh.sh ssh_opts=(-o "UserKnownHostsFile=/dev/null") ssh_opts+=(-o "StrictHostKeyChecking=no") diff --git a/scripts/drevops/mirror-code.sh b/scripts/drevops/mirror-code.sh index 17b4567e4..154af9b25 100755 --- a/scripts/drevops/mirror-code.sh +++ b/scripts/drevops/mirror-code.sh @@ -62,7 +62,7 @@ info "Started code mirroring." [ "$(git config --global user.name)" == "" ] && note "Configuring global git user name." && git config --global user.name "${DREVOPS_MIRROR_CODE_GIT_USER_NAME}" [ "$(git config --global user.email)" == "" ] && note "Configuring global git user email." && git config --global user.email "${DREVOPS_MIRROR_CODE_GIT_USER_EMAIL}" -DREVOPS_SSH_PREFIX="MIRROR_CODE" ./scripts/drevops/setup-ssh.sh +export DREVOPS_SSH_PREFIX="MIRROR_CODE" && . ./scripts/drevops/setup-ssh.sh # Create a temp directory to copy source repository into to prevent changes to source. SRC_TMPDIR=$(mktemp -d) diff --git a/scripts/drevops/task-custom-lagoon.sh b/scripts/drevops/task-custom-lagoon.sh index 2bd3dd7ae..efab258b2 100755 --- a/scripts/drevops/task-custom-lagoon.sh +++ b/scripts/drevops/task-custom-lagoon.sh @@ -67,7 +67,7 @@ info "Started Lagoon task ${DREVOPS_TASK_LAGOON_NAME}." [ -z "${DREVOPS_TASK_LAGOON_COMMAND}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_COMMAND." && exit 1 [ -z "${DREVOPS_TASK_LAGOON_PROJECT}" ] && echo "Missing required value for DREVOPS_TASK_LAGOON_PROJECT." && exit 1 -DREVOPS_SSH_PREFIX="TASK" ./scripts/drevops/setup-ssh.sh +export DREVOPS_SSH_PREFIX="TASK" && . ./scripts/drevops/setup-ssh.sh if ! command -v lagoon >/dev/null || [ -n "${DREVOPS_LAGOONCLI_FORCE_INSTALL}" ]; then note "Installing Lagoon CLI."