[DO-1519] add messenger master web host and some refactoring (!79)

Co-authored-by: Rustam Tagaev <rustam.tagaev@avroid.tech>
Reviewed-on: https://git.avroid.tech/DevOps/jenkins-pipelines/pulls/79
Reviewed-by: Denis Patrakeev <denis.patrakeev@avroid.team>
This commit is contained in:
Rustam Tagaev
2025-02-11 13:39:38 +03:00
parent 8b5251920c
commit 39dd4cf5a0
4 changed files with 243 additions and 44 deletions

View File

@@ -34,13 +34,13 @@ import java.util.regex.Pattern
def createGetHttpClient(String url, String jenkinsCreds) {
def jenkinsCredentials = CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class)
def credentials = jenkinsCredentials.findResult { it.id == jenkinsCreds ? it : null }
String auth = credentials.username + ":" + credentials.password;
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes("utf-8"));
String authHeaderValue = "Basic " + encodedAuth;
String auth = 'robot' + '\$' + 'ci' + ":" + credentials.password
String encodedAuth = Base64.getEncoder().encodeToString(auth.getBytes("utf-8"))
String authHeaderValue = "Basic " + encodedAuth
def httpClient = new URL(url).openConnection() as HttpURLConnection
httpClient.setRequestMethod('GET');
httpClient.setRequestProperty("Authorization", authHeaderValue);
httpClient.setRequestProperty("Accept", "application/json");
httpClient.setRequestMethod('GET')
httpClient.setRequestProperty("Authorization", authHeaderValue)
httpClient.setRequestProperty("Accept", "application/json")
return httpClient
}