Skip to content

Commit 5e7fe20

Browse files
SNOW-2272485: CICD reconfiguration (#2485)
1 parent a718922 commit 5e7fe20

File tree

13 files changed

+39
-18
lines changed

13 files changed

+39
-18
lines changed

.github/workflows/build_test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ jobs:
196196
- name: Setup private key file
197197
shell: bash
198198
env:
199-
PYTHON_PRIVATE_KEY_SECRET: ${{ secrets.PYTHON_PRIVATE_KEY_SECRET }}
199+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
200200
run: |
201-
gpg --quiet --batch --yes --decrypt --passphrase="$PYTHON_PRIVATE_KEY_SECRET" \
201+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
202202
.github/workflows/parameters/public/rsa_keys/rsa_key_python_${{ matrix.cloud-provider }}.p8.gpg > test/rsa_key_python_${{ matrix.cloud-provider }}.p8
203203
- name: Download wheel(s)
204204
uses: actions/download-artifact@v4
@@ -274,9 +274,9 @@ jobs:
274274
- name: Setup private key file
275275
shell: bash
276276
env:
277-
PYTHON_PRIVATE_KEY_SECRET: ${{ secrets.PYTHON_PRIVATE_KEY_SECRET }}
277+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
278278
run: |
279-
gpg --quiet --batch --yes --decrypt --passphrase="$PYTHON_PRIVATE_KEY_SECRET" \
279+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
280280
.github/workflows/parameters/public/rsa_keys/rsa_key_python_${{ matrix.cloud-provider }}.p8.gpg > test/rsa_key_python_${{ matrix.cloud-provider }}.p8
281281
- name: Upgrade setuptools, pip and wheel
282282
run: python -m pip install -U setuptools pip wheel
@@ -342,9 +342,9 @@ jobs:
342342
- name: Setup private key file
343343
shell: bash
344344
env:
345-
PYTHON_PRIVATE_KEY_SECRET: ${{ secrets.PYTHON_PRIVATE_KEY_SECRET }}
345+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
346346
run: |
347-
gpg --quiet --batch --yes --decrypt --passphrase="$PYTHON_PRIVATE_KEY_SECRET" \
347+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
348348
.github/workflows/parameters/public/rsa_keys/rsa_key_python_${{ matrix.cloud-provider }}.p8.gpg > test/rsa_key_python_${{ matrix.cloud-provider }}.p8
349349
- name: Download wheel(s)
350350
uses: actions/download-artifact@v4
@@ -402,9 +402,9 @@ jobs:
402402
- name: Setup private key file
403403
shell: bash
404404
env:
405-
PYTHON_PRIVATE_KEY_SECRET: ${{ secrets.PYTHON_PRIVATE_KEY_SECRET }}
405+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
406406
run: |
407-
gpg --quiet --batch --yes --decrypt --passphrase="$PYTHON_PRIVATE_KEY_SECRET" \
407+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
408408
.github/workflows/parameters/public/rsa_keys/rsa_key_python_${{ matrix.cloud-provider }}.p8.gpg > test/rsa_key_python_${{ matrix.cloud-provider }}.p8
409409
- name: Download wheel(s)
410410
uses: actions/download-artifact@v4
-510 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Jenkinsfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ timestamps {
3333
string(name: 'client_git_commit', value: scmInfo.GIT_COMMIT),
3434
string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH),
3535
string(name: 'parent_job', value: env.JOB_NAME),
36-
string(name: 'parent_build_number', value: env.BUILD_NUMBER)
36+
string(name: 'parent_build_number', value: env.BUILD_NUMBER),
37+
string(name: 'USE_PASSWORD', value: 'true')
3738
]
3839
parallel(
3940
'Test': {

ci/test_darwin.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ export JUNIT_REPORT_DIR=${SF_REGRESS_LOGS:-$CONNECTOR_DIR}
1414
export COV_REPORT_DIR=${CONNECTOR_DIR}
1515

1616
# Decrypt parameters file
17-
PARAMS_FILE="${PARAMETERS_DIR}/jenkins_test_parameters.py.gpg"
17+
PARAMS_FILE="${PARAMETERS_DIR}/parameters_aws.py.gpg"
1818
[ ${cloud_provider} == azure ] && PARAMS_FILE="${PARAMETERS_DIR}/parameters_azure.py.gpg"
1919
[ ${cloud_provider} == gcp ] && PARAMS_FILE="${PARAMETERS_DIR}/parameters_gcp.py.gpg"
2020
gpg --quiet --batch --yes --decrypt --passphrase="${PARAMETERS_SECRET}" ${PARAMS_FILE} > test/parameters.py
2121

22+
# Decrypt private key file
23+
gpg --quiet --batch --yes --decrypt --passphrase="${PARAMETERS_SECRET}" "${CONNECTOR_DIR}/.github/workflows/parameters/public/rsa_keys/rsa_key_python_${cloud_provider}.p8.gpg" > "test/rsa_key_python_${cloud_provider}.p8"
24+
2225
rm -rf venv
2326
python3.12 -m venv venv
2427
. venv/bin/activate

ci/test_docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ docker run --network=host \
4545
-e JENKINS_HOME \
4646
-e is_old_driver \
4747
-e GITHUB_ACTIONS \
48+
-e USE_PASSWORD=true \
4849
--mount type=bind,source="${CONNECTOR_DIR}",target=/home/user/snowflake-connector-python \
4950
${CONTAINER_NAME}:1.0 \
5051
/home/user/snowflake-connector-python/ci/test_linux.sh ${PYTHON_ENV}

ci/test_fips.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
#!/bin/bash -e
22
#
3-
# Test Snowflake Connector
4-
# Note this is the script that test_docker.sh runs inside of the docker container
3+
# Test Snowflake Connector (FIPS)
4+
# Note this is the script that test_fips_docker.sh runs inside of the docker container
55
#
6+
7+
# Export USE_PASSWORD only on Jenkins (not on GitHub Actions)
8+
# Jenkins FIPS tests run against mocked Snowflake with password auth
9+
# GitHub Actions FIPS tests run against real Snowflake with key-pair auth
10+
if [[ "${JENKINS_HOME}" != "false" && -n "${JENKINS_HOME}" ]]; then
11+
export USE_PASSWORD=true
12+
echo "[Info] Jenkins detected: Using password authentication for FIPS tests"
13+
else
14+
echo "[Info] GitHub Actions detected: Using key-pair authentication for FIPS tests"
15+
fi
16+
617
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
718
# shellcheck disable=SC1090
819
CONNECTOR_DIR="$( dirname "${THIS_DIR}")"

ci/test_linux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# - This script assumes that ../dist/repaired_wheels has the wheel(s) built for all versions to be tested
77
# - This is the script that test_docker.sh runs inside of the docker container
88

9+
910
PYTHON_VERSIONS="${1:-3.9 3.10 3.11 3.12 3.13}"
1011
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1112
CONNECTOR_DIR="$( dirname "${THIS_DIR}")"

0 commit comments

Comments
 (0)