From 0cb8ec263302d14f7ae2e2e974e833abf87503e3 Mon Sep 17 00:00:00 2001 From: Patryk Czajka Date: Tue, 30 Sep 2025 15:33:28 +0200 Subject: [PATCH] Fix failing Jenkins jobs --- ci/setup_gpg_home.sh | 19 +++++++++++++++++++ ci/test_authentication.sh | 2 ++ ci/test_wif.sh | 1 + 3 files changed, 22 insertions(+) create mode 100644 ci/setup_gpg_home.sh diff --git a/ci/setup_gpg_home.sh b/ci/setup_gpg_home.sh new file mode 100644 index 0000000000..0943e6bbf0 --- /dev/null +++ b/ci/setup_gpg_home.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# GPG setup script for creating unique GPG home directory + +setup_gpg_home() { + # Create unique GPG home directory + export GNUPGHOME="${THIS_DIR}/.gnupg_$$_$(date +%s%N)_${BUILD_NUMBER:-}" + mkdir -p "$GNUPGHOME" + chmod 700 "$GNUPGHOME" + + cleanup_gpg() { + if [[ -n "$GNUPGHOME" && -d "$GNUPGHOME" ]]; then + rm -rf "$GNUPGHOME" + fi + } + trap cleanup_gpg EXIT +} + +setup_gpg_home diff --git a/ci/test_authentication.sh b/ci/test_authentication.sh index 7e238f79e3..d829b2085f 100755 --- a/ci/test_authentication.sh +++ b/ci/test_authentication.sh @@ -15,6 +15,8 @@ if [[ -n "$JENKINS_HOME" ]]; then fi +source "$THIS_DIR/setup_gpg_home.sh" + gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../.github/workflows/parameters/private/parameters_aws_auth_tests.json "$THIS_DIR/../.github/workflows/parameters/private/parameters_aws_auth_tests.json.gpg" gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../.github/workflows/parameters/private/rsa_keys/rsa_key.p8 "$THIS_DIR/../.github/workflows/parameters/private/rsa_keys/rsa_key.p8.gpg" gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output $THIS_DIR/../.github/workflows/parameters/private/rsa_keys/rsa_key_invalid.p8 "$THIS_DIR/../.github/workflows/parameters/private/rsa_keys/rsa_key_invalid.p8.gpg" diff --git a/ci/test_wif.sh b/ci/test_wif.sh index 16798f934d..4e01cab8ae 100755 --- a/ci/test_wif.sh +++ b/ci/test_wif.sh @@ -67,6 +67,7 @@ get_branch() { } setup_parameters() { + source "$THIS_DIR/setup_gpg_home.sh" gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output "$RSA_KEY_PATH_AWS_AZURE" "${RSA_KEY_PATH_AWS_AZURE}.gpg" gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output "$RSA_KEY_PATH_GCP" "${RSA_KEY_PATH_GCP}.gpg" chmod 600 "$RSA_KEY_PATH_AWS_AZURE"