8000 travis-build.sh: import GPG key, but don't decrypt · hadim/scijava-scripts@2605abf · GitHub
[go: up one dir, main page]

Skip to content

Commit 2605abf

Browse files
committed
travis-build.sh: import GPG key, but don't decrypt
The decryption will be done in the before_install phase, as specified in the .travis.yml. This is what "travis encrypt-file" sets up when you pass "--add". It is a nice way to do it because the environment-specific stuff all stays in .travis.yml at the end, and we do not need to pass key and iv values into travis-build.sh.
1 parent 37d36d3 commit 2605abf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

travis-build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ cat >"$settingsFile" <<EOL
5353
</settings>
5454
EOL
5555

56-
# Populate the GPG signing key.
56+
# Import the GPG signing key.
5757
keyFile=.travis/signingkey.asc
5858
if [ "$TRAVIS_SECURE_ENV_VARS" = true \
5959
-a "$TRAVIS_PULL_REQUEST" = false \
60-
-a -f "$keyFile.enc" -a -e "$1" -a -e "$2" ]
60+
-a -f "$keyFile" ]
6161
then
62-
echo "== Decrypting GPG keypair =="
63-
openssl aes-256-cbc -K "$1" -iv "$2" -in "$keyFile.enc" -out "$keyFile" -d &&
62+
echo "== Importing GPG keypair =="
6463
gpg --batch --fast-import "$keyFile" --passphrase "$GPG_PASSPHRASE"
6564
fi
6665

0 commit comments

Comments
 (0)
0