Skip to content

Commit

Permalink
Upgrade nebula.netflixoss to replace bintray publication and update T…
Browse files Browse the repository at this point in the history
…ravisCI Secrets (#920)
  • Loading branch information
rpalcolea authored Mar 5, 2021
1 parent 243afcf commit 33eed15
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 31 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Thumbs.db
.gradle
.m2


# Build output directies
/target
*/target
Expand All @@ -67,3 +68,6 @@ atlassian-ide-plugin.xml
# NetBeans specific files/directories
.nbattrs
>>>>>>> build/multi-project

# publishing secrets
secrets/signing-key
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ jdk:
sudo: false
git:
depth: 100
install: ./installViaTravis.sh
script: ./buildViaTravis.sh
install: "./installViaTravis.sh"
script: "./buildViaTravis.sh"
cache:
directories:
- $HOME/.gradle
- "$HOME/.gradle"
env:
global:
- secure: p81PYYYYhjhp1uJHOoT9EfUia8qPMphdykCxQannWMVvIFKXF5ibi/Qd52OUIYuJT9Q5MN9GhlwCtolxmCZu44YMLi99LsoITAv6n08LAFEux1oAOXmGt3ZBllvBFtlW+jlQ5lKmbuuPue3RVbTaWzL3KCCaYQ4uKW/sP31bXic=
- secure: AYWrIC/1JqAVyLhzlDhL163LypPpq7AliDltfey9emxzS73vB5VrGTHG45Em7xdkHN0kc1vED+UFsYks7ym1olXZPsbW29R0Gfd+p1VxCE3Cbhj7x690xNC3wIlSgWGpbgiPs7vhVN80OuNgnpz9/+WRFpKAVrYrcisbvugsDqk=
- secure: Ai75crFDh3imkmxzNQDXIwK49appZuZTrsmdZzgH1Zl/nD33RoZPWUWeeHP0yJoicNqZlU6aEXJnk8JGDWtPIT3VNO7Rsey+yrw041rHNV6bFGpwGdQgKv5CUhRHK+gShgFgnME5THCPKvK51+li1feIoByoYVmEn0gmvcxL0yM=
- secure: ZqBsyaFMBz3cqM7UHq0I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19GLN2vv2vsgY4ejhXjeer1kwqm0l/1bXtfqo0uHyD+CFn2yINV20oKHScYNS4fwKnJ8aC60MZqAj6zddfe2VvEeDIKDiejpz4AfRJwgqpl9B0FrNtZ/1oU5n8oneTKpVFryTs=
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nebula.netflixoss' version '7.1.3'
id 'nebula.netflixoss' version '9.1.0'
id 'com.github.sherter.google-java-format' version '0.8'
}

Expand Down Expand Up @@ -78,7 +78,7 @@ allprojects {
compile 'com.google.http-client:google-http-client-jackson2:1.28.0'
compile 'com.netflix.spectator:spectator-api:0.96.0'
compileOnly 'javax.servlet:javax.servlet-api:3.1.0'
testCompile 'org.jmockit:jmockit:1.31'
testCompile 'org.jmockit:jmockit:1.38'
testCompile "org.spockframework:spock-core:1.1-groovy-2.4"
testCompile "com.google.truth:truth:1.0.1"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
Expand Down
11 changes: 6 additions & 5 deletions buildViaTravis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew build --stacktrace
./gradlew build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot --stacktrace
./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" build snapshot
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
*-rc\.*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" candidate --stacktrace
./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" -Prelease.useLastTag=true candidate
;;
*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace
./gradlew -Prelease.travisci=true -PnetflixOss.username="$NETFLIX_OSS_REPO_USERNAME" -PnetflixOss.password="$NETFLIX_OSS_REPO_PASSWORD" -Psonatype.username="$NETFLIX_OSS_SONATYPE_USERNAME" -Psonatype.password="$NETFLIX_OSS_SONATYPE_PASSWORD" -Psonatype.signingPassword="$NETFLIX_OSS_SIGNING_PASSWORD" -Prelease.useLastTag=true final
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew build --stacktrace
./gradlew build
fi

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
15 changes: 3 additions & 12 deletions installViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew assemble --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true assemble --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Assemble Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true assemble --stacktrace
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew assemble --stacktrace
if [ "$TRAVIS_SECURE_ENV_VARS" = "true" ]; then
echo "Decrypting publishing credentials"
openssl aes-256-cbc -k "$NETFLIX_OSS_SIGNING_FILE_PASSWORD" -in secrets/signing-key.enc -out secrets/signing-key -d
fi
9 changes: 8 additions & 1 deletion priam/build.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
apply plugin: 'groovy'
apply plugin: 'groovy'

/**
* This is from https://jmockit.github.io/tutorial/Introduction.html#runningTests
*/
test {
jvmArgs "-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ ImmutableSetMultimap<String, FileUploadResult> getFileUploadResults(
* Gives the prefix (common name) of the sstable components. Returns an empty Optional if it is
* not an sstable component or a manifest or schema file.
*
* <p>For example: mc-3-big-Data.db --> mc-3-big ks-cf-ka-7213-Index.db --> ks-cf-ka-7213
* <p>For example: mc-3-big-Data.db -- mc-3-big ks-cf-ka-7213-Index.db -- ks-cf-ka-7213
*
* @param file the file from which to extract a common prefix.
* @return common prefix of the file, or empty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public class TokenRetrieverUtils {
* @param dc
* @return IP of the token owner based on gossip information or null if C* status doesn't
* converge.
* @throws GossipParseException when required number of instances are not available to fetch the
* gossip info.
*/
public static InferredTokenOwnership inferTokenOwnerFromGossip(
List<? extends PriamInstance> allIds, String token, String dc) {
Expand Down
Binary file added secrets/signing-key.enc
Binary file not shown.

0 comments on commit 33eed15

Please sign in to comment.