-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add proxy & update gradle, spring boot, jdk (#32)
* add proxy & update gradle, spring boot, jdk * update gradle.yml * fix test
- Loading branch information
Showing
9 changed files
with
89 additions
and
45 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
43 changes: 43 additions & 0 deletions
43
src/main/java/io/github/tttol/mrls/config/RestClientConfig.java
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,43 @@ | ||
package io.github.tttol.mrls.config; | ||
|
||
import io.micrometer.common.util.StringUtils; | ||
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; | ||
import org.apache.hc.client5.http.impl.classic.HttpClients; | ||
import org.apache.hc.core5.http.HttpHost; | ||
import org.apache.hc.core5.util.Timeout; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.client.ClientHttpRequestFactory; | ||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | ||
import org.springframework.http.client.SimpleClientHttpRequestFactory; | ||
import org.springframework.web.client.RestClient; | ||
|
||
import java.net.InetSocketAddress; | ||
import java.net.Proxy; | ||
|
||
@Configuration | ||
public class RestClientConfig { | ||
|
||
@Value("${app.proxy.host}") | ||
private String proxyHost; | ||
|
||
@Value("${app.proxy.port}") | ||
private int proxyPort; | ||
|
||
@Bean | ||
public RestClient restClient() { | ||
if (StringUtils.isBlank(proxyHost)) { | ||
return RestClient.create(); | ||
} | ||
|
||
var httpClient = HttpClients.custom() | ||
.setProxy(new HttpHost(proxyHost, proxyPort)) | ||
.build(); | ||
var httpComponentsClientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); | ||
|
||
return RestClient.builder() | ||
.requestFactory(httpComponentsClientHttpRequestFactory) | ||
.build(); | ||
} | ||
} |
41 changes: 21 additions & 20 deletions
41
src/main/java/io/github/tttol/mrls/external/GitLabApiExecutor.java
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
app: | ||
proxy: | ||
host: | ||
port: | ||
gitlab: | ||
project: | ||
id: | ||
|
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
app: | ||
proxy: | ||
host: ${PROXY_HOST} | ||
port: ${PROXY_PORT} | ||
gitlab: | ||
host: ${GITLAB_HOST} | ||
project: | ||
|
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