Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade nebula.netflixoss to replace bintray publication and update TravisCI Secrets #475

Merged
merged 2 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ atlassian-ide-plugin.xml

# NetBeans specific files/directories
.nbattrs

# publishing secrets
secrets/signing-key
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ install: "./installViaTravis.sh"
script: "./buildViaTravis.sh"
env:
global:
- secure: mprd3lRQDzNFIqWJ/hhHt84Oo1rQFv5Hp2GyySTx/xPiu2Qv6F+C0YOHTHIT2+BxxW/7580w/8e6L8YLxiVX0d2J8YwQm7tPoc4WN3kV9K6U/LTdVmNAePNyeMq1R13CPAguDVG2CY4+Y08rdU7OYDuL1mQFHzPmvhGzLnN4kiE=
- secure: INE6Zlu2EMfRZI13F8B4RyKkmvtaMA8K5bMYwRPWDJ+PUnGUfU27xIjx8mY+dd6A2JfSeeoF7dkOko4xi+PiiayY2Byi8fneja1j01Du7l0okBaeROGlLscLid2ME0yDCql06vERhCdIDEBMpZzVu8GbqpZ1z/x0JQ0YgBiMVEc=
- secure: OumwxBfa3lOrT2BHRx9a9Ppxiua0IbEtRFs2CQHCWOW6iYRLDavLqya+oMPvx+gAlZRX54VTYuuxh858dxR8O94xPi4NvZ/POvoTdgU1MNekBqYsuWys3B4Dw8CMrrpfzvtD8tWe8TkgwGpzzpRuEzQ6bvh0uCAmiQ0kQhKA8+0=
- secure: TeSjCxSjlH0fE30WoBWOPIWPMMn66v6K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R2u+KVP3Fg9aVo5ECgJsenC28cYl7YitogHLl4bfpJVLnMtySzkMF2A7dHuR9semnliqCBcClgxwvX2k/1eUFSBdHkOucy6ZJelCzitvhJ9jQcQFSx6D5SoIUSZk=
cache:
directories:
- "$HOME/.gradle/caches"
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nebula.netflixoss' version '2.2.10'
id 'nebula.netflixoss' version '9.1.0'
}

// Establish version and status
Expand Down
8 changes: 5 additions & 3 deletions buildViaTravis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
./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
./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
./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
./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
fi


2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.8.3-all.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
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Assemble Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew -Prelease.travisci=true assemble
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
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew assemble
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
3 changes: 3 additions & 0 deletions ribbon-eureka/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ dependencies {
compile project(':ribbon-core')
compile project(':ribbon-loadbalancer')
compile "com.netflix.eureka:eureka-client:${eureka_version}"
compile "com.netflix.archaius:archaius-core:0.7.5"
compile "commons-configuration:commons-configuration:1.8"
compile "javax.inject:javax.inject:1"
compile 'com.google.code.findbugs:annotations:2.0.0'
compile "org.slf4j:slf4j-api:${slf4j_version}"

Expand Down
1 change: 0 additions & 1 deletion ribbon-evcache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dependencies {
compile "io.reactivex:rxjava:${rx_java_version}"
compile "org.slf4j:slf4j-api:${slf4j_version}"
testCompile project(':ribbon-test')
testCompile project(path: ':ribbon', configuration: 'test')
testCompile "junit:junit:${junit_version}"
testCompile "org.powermock:powermock-easymock-release-full:${powermock_version}"
testCompile "org.easymock:easymock:${easymock_version}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.ribbon.proxy.sample;

import com.netflix.hystrix.HystrixInvokableInfo;
import com.netflix.ribbon.ServerError;
import com.netflix.ribbon.UnsuccessfulResponseException;
import com.netflix.ribbon.http.HttpResponseValidator;
import com.netflix.ribbon.hystrix.FallbackHandler;
import io.netty.buffer.ByteBuf;
import io.reactivex.netty.protocol.http.client.HttpClientResponse;
import rx.Observable;

import java.util.Map;

/**
* @author Tomasz Bak
*/
public class HystrixHandlers {

public static class SampleHttpResponseValidator implements HttpResponseValidator {

@Override
public void validate(HttpClientResponse<ByteBuf> response) throws UnsuccessfulResponseException, ServerError {
}
}

public static class MovieFallbackHandler implements FallbackHandler<Movie> {

@Override
public Observable<Movie> getFallback(HystrixInvokableInfo<?> hystrixInfo, Map<String, Object> requestProperties) {
return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.netflix.ribbon.proxy.sample;

/**
* @author Tomasz Bak
*/
public class Movie {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
package com.netflix.ribbon.proxy.sample;

import com.netflix.ribbon.RibbonRequest;
import com.netflix.ribbon.proxy.annotation.*;
import com.netflix.ribbon.proxy.annotation.ClientProperties.Property;
import com.netflix.ribbon.proxy.annotation.Http.Header;
import com.netflix.ribbon.proxy.annotation.Http.HttpMethod;
import com.netflix.ribbon.proxy.sample.HystrixHandlers.MovieFallbackHandler;
import com.netflix.ribbon.proxy.sample.HystrixHandlers.SampleHttpResponseValidator;
import io.netty.buffer.ByteBuf;
import rx.Observable;

import java.util.concurrent.atomic.AtomicReference;

import static com.netflix.ribbon.proxy.sample.ResourceGroupClasses.SampleHttpResourceGroup;

/**
* @author Tomasz Bak
*/
public class MovieServiceInterfaces {

@ClientProperties(properties = {
@Property(name="ReadTimeout", value="2000"),
@Property(name="ConnectTimeout", value="1000"),
@Property(name="MaxAutoRetriesNextServer", value="2")
}, exportToArchaius = true)
public static interface SampleMovieService {

@TemplateName("findMovieById")
@Http(
method = HttpMethod.GET,
uri = "/movies/{id}",
headers = {
@Header(name = "X-MyHeader1", value = "value1.1"),
@Header(name = "X-MyHeader1", value = "value1.2"),
@Header(name = "X-MyHeader2", value = "value2")
})
@Hystrix(
cacheKey = "findMovieById/{id}",
validator = SampleHttpResponseValidator.class,
fallbackHandler = MovieFallbackHandler.class)
@CacheProvider(key = "findMovieById_{id}", provider = SampleCacheProviderFactory.class)
RibbonRequest<ByteBuf> findMovieById(@Var("id") String id);

@TemplateName("findRawMovieById")
@Http(method = HttpMethod.GET, uri = "/rawMovies/{id}")
RibbonRequest<ByteBuf> findRawMovieById(@Var("id") String id);

@TemplateName("findMovie")
@Http(method = HttpMethod.GET, uri = "/movies?name={name}&author={author}")
RibbonRequest<ByteBuf> findMovie(@Var("name") String name, @Var("author") String author);

@TemplateName("registerMovie")
@Http(method = HttpMethod.POST, uri = "/movies")
@Hystrix(cacheKey = "registerMovie", fallbackHandler = MovieFallbackHandler.class)
@ContentTransformerClass(MovieTransformer.class)
RibbonRequest<ByteBuf> registerMovie(@Content Movie movie);

@Http(method = HttpMethod.PUT, uri = "/movies/{id}")
@ContentTransformerClass(MovieTransformer.class)
RibbonRequest<ByteBuf> updateMovie(@Var("id") String id, @Content Movie movie);

@Http(method = HttpMethod.PATCH, uri = "/movies/{id}")
@ContentTransformerClass(MovieTransformer.class)
RibbonRequest<ByteBuf> updateMoviePartial(@Var("id") String id, @Content Movie movie);

@TemplateName("registerTitle")
@Http(method = HttpMethod.POST, uri = "/titles")
@Hystrix(cacheKey = "registerTitle", fallbackHandler = MovieFallbackHandler.class)
RibbonRequest<ByteBuf> registerTitle(@Content String title);

@TemplateName("registerByteBufBinary")
@Http(method = HttpMethod.POST, uri = "/binaries/byteBuf")
@Hystrix(cacheKey = "registerByteBufBinary", fallbackHandler = MovieFallbackHandler.class)
RibbonRequest<ByteBuf> registerByteBufBinary(@Content ByteBuf binary);

@TemplateName("registerByteArrayBinary")
@Http(method = HttpMethod.POST, uri = "/binaries/byteArray")
@Hystrix(cacheKey = "registerByteArrayBinary", fallbackHandler = MovieFallbackHandler.class)
RibbonRequest<ByteBuf> registerByteArrayBinary(@Content byte[] binary);

@TemplateName("deleteMovie")
@Http(method = HttpMethod.DELETE, uri = "/movies/{id}")
RibbonRequest<ByteBuf> deleteMovie(@Var("id") String id);
}

public static interface ShortMovieService {
@TemplateName("findMovieById")
@Http(method = HttpMethod.GET, uri = "/movies/{id}")
RibbonRequest<ByteBuf> findMovieById(@Var("id") String id);

@TemplateName("findMovieById")
@Http(method = HttpMethod.GET, uri = "/movies")
RibbonRequest<ByteBuf> findAll();
}

public static interface BrokenMovieService {

@Http(method = HttpMethod.GET)
Movie returnTypeNotRibbonRequest();

Movie missingHttpAnnotation();

@Http(method = HttpMethod.GET)
RibbonRequest<ByteBuf> multipleContentParameters(@Content Movie content1, @Content Movie content2);
}

@ResourceGroup(name = "testResourceGroup")
public static interface SampleMovieServiceWithResourceGroupNameAnnotation {

}

@ResourceGroup(resourceGroupClass = SampleHttpResourceGroup.class)
public static interface SampleMovieServiceWithResourceGroupClassAnnotation {

}

@ResourceGroup(name = "testResourceGroup", resourceGroupClass = SampleHttpResourceGroup.class)
public static interface BrokenMovieServiceWithResourceGroupNameAndClassAnnotation {

}

@ResourceGroup(name = "testResourceGroup")
public static interface TemplateNameDerivedFromMethodName {
@Http(method = HttpMethod.GET, uri = "/template")
RibbonRequest<ByteBuf> myTemplateName();
}

@ResourceGroup(name = "testResourceGroup")
public static interface HystrixOptionalAnnotationValues {

@TemplateName("hystrix1")
@Http(method = HttpMethod.GET, uri = "/hystrix/1")
@Hystrix(cacheKey = "findMovieById/{id}")
RibbonRequest<ByteBuf> hystrixWithCacheKeyOnly();

@TemplateName("hystrix2")
@Http(method = HttpMethod.GET, uri = "/hystrix/2")
@Hystrix(validator = SampleHttpResponseValidator.class)
RibbonRequest<ByteBuf> hystrixWithValidatorOnly();

@TemplateName("hystrix3")
@Http(method = HttpMethod.GET, uri = "/hystrix/3")
@Hystrix(fallbackHandler = MovieFallbackHandler.class)
RibbonRequest<ByteBuf> hystrixWithFallbackHandlerOnly();

}

@ResourceGroup(name = "testResourceGroup")
public static interface PostsWithDifferentContentTypes {

@TemplateName("rawContentSource")
@Http(method = HttpMethod.POST, uri = "/content/rawContentSource")
@ContentTransformerClass(MovieTransformer.class)
RibbonRequest<ByteBuf> postwithRawContentSource(AtomicReference<Object> arg1, int arg2, @Content Observable<Movie> movie);

@TemplateName("byteBufContent")
@Http(method = HttpMethod.POST, uri = "/content/byteBufContent")
RibbonRequest<ByteBuf> postwithByteBufContent(@Content ByteBuf byteBuf);

@TemplateName("byteArrayContent")
@Http(method = HttpMethod.POST, uri = "/content/byteArrayContent")
RibbonRequest<ByteBuf> postwithByteArrayContent(@Content byte[] bytes);

@TemplateName("stringContent")
@Http(method = HttpMethod.POST, uri = "/content/stringContent")
RibbonRequest<ByteBuf> postwithStringContent(@Content String content);

@TemplateName("movieContent")
@Http(method = HttpMethod.POST, uri = "/content/movieContent")
@ContentTransformerClass(MovieTransformer.class)
RibbonRequest<ByteBuf> postwithMovieContent(@Content Movie movie);

@TemplateName("movieContentBroken")
@Http(method = HttpMethod.POST, uri = "/content/movieContentBroken")
RibbonRequest<ByteBuf> postwithMovieContentBroken(@Content Movie movie);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.ribbon.proxy.sample;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.reactivex.netty.channel.ContentTransformer;

/**
* @author Tomasz Bak
*/
public class MovieTransformer implements ContentTransformer<MovieTransformer> {
@Override
public ByteBuf call(MovieTransformer toTransform, ByteBufAllocator byteBufAllocator) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.netflix.ribbon.proxy.sample;

import com.netflix.ribbon.http.HttpResourceGroup;

/**
* @author Tomasz Bak
*/
public class ResourceGroupClasses {
public static class SampleHttpResourceGroup extends HttpResourceGroup {
public SampleHttpResourceGroup() {
super("myTestGroup");
}
}
}
Loading