Prechádzať zdrojové kódy

Обновить 'Jenkins/jenkinsfile'

vmshay 5 rokov pred
rodič
commit
2c0492af14
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      Jenkins/jenkinsfile

+ 4 - 1
Jenkins/jenkinsfile

@@ -2,11 +2,14 @@
 def GetLog(build_url) {
 	def logurl = build_url + 'consoleText'
 	def strip = logurl.replaceAll('http://','')
+	def creds = "admin:admin"
+	String auth = creds.bytes.encodeBase64().toString()
 
     withCredentials([string(credentialsId: 'JenkinsAPI', variable: 'token')]){
     	responce = httpRequest(contentType: 'APPLICATION_JSON', 
 		httpMode: 'GET',
-		url: 'http://admin:' + token +'@' + strip)
+		url: 'http:// + strip,
+		customHeaders:[[name:'Authorization', value:"Basic ${auth}"]])
     return strip
 	}
 }