This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c48997
commit 2559048
Showing
3 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
ENCRYPTION_KEY=$1 | ||
ENCRYPTION_IV=$2 | ||
|
||
# some sanity checks first: | ||
if [ "x${ENCRYPTION_KEY}" == "x" ]; then | ||
echo "The encryption key has not been provided. Skipping signing preparation" | ||
exit 1 | ||
fi | ||
|
||
if [ "x${ENCRYPTION_IV}" == "x" ]; then | ||
echo "The encryption initialization vector has not been provided. Skipping signing preparation" | ||
exit 2 | ||
fi | ||
|
||
if [ "${TRAVIS_SECURE_ENV_VARS}" == true ]; then | ||
openssl aes-256-cbc -K "${ENCRYPTION_KEY}" -iv "${ENCRYPTION_IV}" -in travis/signing-key.asc.enc -out travis/signing-key.asc -d | ||
if (( $? == 0 )); then | ||
echo "Failed to decrypt the signing key. Skipping." | ||
exit 3 | ||
fi | ||
|
||
gpg --no-tty --batch --allow-secret-key-import --import travis/signing-key.asc | ||
rm -rf "$HOME/.gradle/gradle.properties" | ||
echo signing.keyId="${SIGNING_KEY_ID}" > "$HOME/.gradle/gradle.properties" | ||
echo signing.password="${SIGNING_KEY_PASSPHRASE}" >> "$HOME/.gradle/gradle.properties" | ||
echo ossrhUsername="${SONATYPE_USERNAME}" >> "$HOME/.gradle/gradle.properties" | ||
echo ossrhPassword="${SONATYPE_PASSWORD}" >> "$HOME/.gradle/gradle.properties" | ||
echo signing.secretKeyRingFile="${HOME}/.gnupg/secring.gpg" >> "$HOME/.gradle/gradle.properties" | ||
else | ||
echo "Travis secure env vars not set. Skipping." | ||
fi |