Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ci/setup_gpg_home.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions ci/test_authentication.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions ci/test_wif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading