File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ if [[ -n "$JENKINS_HOME" ]]; then
1515
1616fi
1717
18+ source " $THIS_DIR /setup_gpg_home.sh"
19+
1820gpg --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"
1921gpg --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"
2022gpg --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"
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ get_branch() {
6161}
6262
6363setup_parameters () {
64+ source " $THIS_DIR /setup_gpg_home.sh"
6465 gpg --quiet --batch --yes --decrypt --passphrase=" $PARAMETERS_SECRET " --output " $RSA_KEY_PATH_AWS_AZURE " " ${RSA_KEY_PATH_AWS_AZURE} .gpg"
6566 gpg --quiet --batch --yes --decrypt --passphrase=" $PARAMETERS_SECRET " --output " $RSA_KEY_PATH_GCP " " ${RSA_KEY_PATH_GCP} .gpg"
6667 chmod 600 " $RSA_KEY_PATH_AWS_AZURE "
You can’t perform that action at this time.
0 commit comments