From 3e64de58b964669312df8442161e191676b01dd2 Mon Sep 17 00:00:00 2001 From: Dominik Przybysz <132913826+sfc-gh-dprzybysz@users.noreply.github.com> Date: Fri, 30 Jun 2023 10:14:11 +0200 Subject: [PATCH] SNOW-852382: Run Windows CI build on azure and gcp (#557) * SNOW-852382: Run Windows CI build on azure and gcp * SNOW-853382: Fail on unknown CLOUD_PROVIDER in CI build --- ci/scripts/set_git_info.sh | 9 ++++++--- ci/test_windows.bat | 14 +++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ci/scripts/set_git_info.sh b/ci/scripts/set_git_info.sh index 323cd5cdc..9c1f3b276 100644 --- a/ci/scripts/set_git_info.sh +++ b/ci/scripts/set_git_info.sh @@ -11,12 +11,15 @@ if [[ -z "$GITHUB_ACTIONS" ]]; then export client_git_commit=${client_git_commit:-$(git log --pretty=oneline | head -1 | awk '{print $1}')} else if [[ "$CLOUD_PROVIDER" == "AZURE" ]]; then - gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../parameters.json $THIS_DIR/../.github/workflows/parameters_azure.json.gpg + ENCODED_PARAMETERS_FILE="$THIS_DIR/../.github/workflows/parameters_azure.json.gpg" elif [[ "$CLOUD_PROVIDER" == "GCP" ]]; then - gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../parameters.json $THIS_DIR/../.github/workflows/parameters_gcp.json.gpg + ENCODED_PARAMETERS_FILE="$THIS_DIR/../.github/workflows/parameters_gcp.json.gpg" + elif [[ "$CLOUD_PROVIDER" == "AWS" ]]; then + ENCODED_PARAMETERS_FILE="$THIS_DIR/../.github/workflows/parameters_aws.json.gpg" else - gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../parameters.json $THIS_DIR/../.github/workflows/parameters_aws.json.gpg + echo "[ERROR] unknown cloud provider" fi + gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../parameters.json $ENCODED_PARAMETERS_FILE export client_git_url=https://github.com/${GITHUB_REPOSITORY}.git export client_git_branch=origin/$(basename ${GITHUB_REF}) export client_git_commit=${GITHUB_SHA} diff --git a/ci/test_windows.bat b/ci/test_windows.bat index 51d8994e0..7f43c62b5 100644 --- a/ci/test_windows.bat +++ b/ci/test_windows.bat @@ -8,7 +8,19 @@ call venv\scripts\activate pip install -U snowflake-connector-python cd %GITHUB_WORKSPACE% -gpg --quiet --batch --yes --decrypt --passphrase=%PARAMETERS_SECRET% --output parameters.json .github/workflows/parameters_aws.json.gpg + +if "%CLOUD_PROVIDER%"=="AZURE" ( + set ENCODED_PARAMETERS_FILE=.github/workflows/parameters_azure.json.gpg +) else if "%CLOUD_PROVIDER%"=="GCP" ( + set ENCODED_PARAMETERS_FILE=.github/workflows/parameters_gcp.json.gpg +) else if "%CLOUD_PROVIDER%"=="AWS" ( + set ENCODED_PARAMETERS_FILE=.github/workflows/parameters_aws.json.gpg +) else ( + echo === unknown cloud provider + exit /b 1 +) + +gpg --quiet --batch --yes --decrypt --passphrase=%PARAMETERS_SECRET% --output parameters.json %ENCODED_PARAMETERS_FILE% REM DON'T FORGET TO include @echo off here or the password may be leaked! echo @echo off>parameters.bat