Explorar o código

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

vmshay %!s(int64=5) %!d(string=hai) anos
pai
achega
8a447368bd
Modificáronse 1 ficheiros con 4 adicións e 6 borrados
  1. 4 6
      Jenkins/jenkinsfile

+ 4 - 6
Jenkins/jenkinsfile

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