Skip to content

Commit 192920d

Browse files
Fix failing Jenkins jobs (#2558)
1 parent 191aa97 commit 192920d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

ci/setup_gpg_home.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# GPG setup script for creating unique GPG home directory
4+
5+
setup_gpg_home() {
6+
# Create unique GPG home directory
7+
export GNUPGHOME="${THIS_DIR}/.gnupg_$$_$(date +%s%N)_${BUILD_NUMBER:-}"
8+
mkdir -p "$GNUPGHOME"
9+
chmod 700 "$GNUPGHOME"
10+
11+
cleanup_gpg() {
12+
if [[ -n "$GNUPGHOME" && -d "$GNUPGHOME" ]]; then
13+
rm -rf "$GNUPGHOME"
14+
fi
15+
}
16+
trap cleanup_gpg EXIT
17+
}
18+
19+
setup_gpg_home

ci/test_authentication.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ if [[ -n "$JENKINS_HOME" ]]; then
1515

1616
fi
1717

18+
source "$THIS_DIR/setup_gpg_home.sh"
19+
1820
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"
1921
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"
2022
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"

ci/test_wif.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ get_branch() {
6767
}
6868

6969
setup_parameters() {
70+
source "$THIS_DIR/setup_gpg_home.sh"
7071
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output "$RSA_KEY_PATH_AWS_AZURE" "${RSA_KEY_PATH_AWS_AZURE}.gpg"
7172
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" --output "$RSA_KEY_PATH_GCP" "${RSA_KEY_PATH_GCP}.gpg"
7273
chmod 600 "$RSA_KEY_PATH_AWS_AZURE"

0 commit comments

Comments
 (0)