Skip to content

Commit

Permalink
SNOW-852382: Run Windows CI build on azure and gcp (#557)
Browse files Browse the repository at this point in the history
* SNOW-852382: Run Windows CI build on azure and gcp
* SNOW-853382: Fail on unknown CLOUD_PROVIDER in CI build
  • Loading branch information
sfc-gh-dprzybysz authored Jun 30, 2023
1 parent 0926a0f commit 3e64de5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 6 additions & 3 deletions ci/scripts/set_git_info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
14 changes: 13 additions & 1 deletion ci/test_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e64de5

Please sign in to comment.