Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Changes based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpkrohling committed Jun 26, 2017
1 parent 6c48997 commit 2559048
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ cache:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
before_install:
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then openssl aes-256-cbc -K $encrypted_677f232983c0_key -iv $encrypted_677f232983c0_iv -in travis/signing-key.asc.enc -out travis/signing-key.asc -d ; fi
- if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then gpg --no-tty --batch --allow-secret-key-import --import travis/signing-key.asc ; fi
- 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"
- ./travis/prepare-signing.sh $encrypted_677f232983c0_key $encrypted_677f232983c0_iv
- if [ "$CROSSDOCK" == true ]; then bash ./travis/install-crossdock-deps.sh ; fi
- sudo rm -rf /usr/local/bin/thrift
- sudo cp travis/docker-thrift/thrift /usr/local/bin/
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ configure(subprojects.findAll {it.name != 'jaeger-thrift'}) {

def getVersionForBuild() {
String candidateVersion = System.env.TRAVIS_TAG

if (null == candidateVersion || candidateVersion.isEmpty()) {
return ext.developmentVersion
}

if (Pattern.compile("[v]?((\\d+)\\.(\\d+)\\.(\\d+))").matcher(candidateVersion).matches()) {
return candidateVersion
}
Expand Down
33 changes: 33 additions & 0 deletions travis/prepare-signing.sh
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

0 comments on commit 2559048

Please sign in to comment.