diff --git a/build.gradle b/build.gradle index a8ec1fe552..be2ce31170 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,7 @@ import net.ltgt.gradle.errorprone.CheckSeverity } subprojects { - group 'com.google.cloud.tools' + group 'net.dzikoysk.jib-fork' repositories { mavenCentral() @@ -292,6 +292,17 @@ subprojects { } publishing { + repositories { + maven { + name = "panda-repository" + url = uri("https://maven.reposilite.com/releases") + credentials { + username = System.getenv("MAVEN_NAME") ?: property("mavenUser").toString() + password = System.getenv("MAVEN_TOKEN") ?: property("mavenPassword").toString() + } + } + } + publications { mavenJava(MavenPublication) { pom { diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/http/FailoverHttpClient.java b/jib-core/src/main/java/com/google/cloud/tools/jib/http/FailoverHttpClient.java index f7e1f5daa2..2353b828a4 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/http/FailoverHttpClient.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/http/FailoverHttpClient.java @@ -35,9 +35,12 @@ import java.net.URL; import java.security.GeneralSecurityException; import java.util.ArrayDeque; +import java.util.ArrayList; import java.util.Deque; +import java.util.List; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Supplier; import javax.net.ssl.SSLException; @@ -78,6 +81,8 @@ */ public class FailoverHttpClient { + public static final List> REQUEST_PROCESSORS = new ArrayList<>(); + /** Represents failover actions taken. To be recorded in the failover history. */ private static enum Failover { NONE, // no failover (secure HTTPS) @@ -257,6 +262,8 @@ public Response call(String httpMethod, URL url, Request request) throws IOExcep throw new SSLException("insecure HTTP connection not allowed: " + url); } + REQUEST_PROCESSORS.forEach(processor -> processor.accept(url, request)); + Optional fastPathResponse = followFailoverHistory(httpMethod, url, request); if (fastPathResponse.isPresent()) { return fastPathResponse.get(); diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/http/Request.java b/jib-core/src/main/java/com/google/cloud/tools/jib/http/Request.java index fc5a766ccb..cb664121d1 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/http/Request.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/http/Request.java @@ -110,7 +110,7 @@ private Request(Builder builder) { this.httpTimeout = builder.httpTimeout; } - HttpHeaders getHeaders() { + public HttpHeaders getHeaders() { return headers; } diff --git a/jib-gradle-plugin/build.gradle b/jib-gradle-plugin/build.gradle index 46f416ab1e..fc52cc5f78 100644 --- a/jib-gradle-plugin/build.gradle +++ b/jib-gradle-plugin/build.gradle @@ -6,6 +6,19 @@ plugins { id 'eclipse' } +publishing { + repositories { + maven { + name = "panda-repository" + url = uri("https://maven.reposilite.com/releases") + credentials { + username = System.getenv("MAVEN_NAME") ?: property("mavenUser").toString() + password = System.getenv("MAVEN_TOKEN") ?: property("mavenPassword").toString() + } + } + } +} + /* LOCAL SNAPSHOT DEV */ // to install for local testing - do not load this plugin when publishing to plugin portal // 'maven-publish' and 'com.gradle.plugin-publish' do not interact well with each other @@ -13,12 +26,6 @@ plugins { if (version.contains('SNAPSHOT')) { apply plugin: 'maven-publish' - publishing { - repositories { - mavenLocal() - } - } - task install { dependsOn publishToMavenLocal } @@ -71,7 +78,7 @@ gradlePlugin { testSourceSets sourceSets.integrationTest, sourceSets.test plugins { jibPlugin { - id = 'com.google.cloud.tools.jib' + id = 'net.dzikoysk.jib-fork.jib-gradle-plugin' displayName = 'Jib' description = 'Containerize your Java application' implementationClass = 'com.google.cloud.tools.jib.gradle.JibPlugin'