Explorar o código

try GetLog function

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

+ 14 - 0
Jenkins/jenkinsfile

@@ -1,4 +1,14 @@
 #!groovy
+def GetLog() {
+    withCredentials([string(credentialsId: 'JenkinsApi', variable: 'token')])
+    responce = httprequest(httpMode: 'GET',
+      url: 'http//admin:token@${BUILD_URL}/consoleText',
+      validResponces: '200')
+    return responce
+}
+
+
+#!groovy
 pipeline {
     agent {
        label 'master'
@@ -28,7 +38,11 @@ pipeline {
       }
       failure {
         echo 'I failed :((('
+<<<<<<< HEAD
+        echo GetLog()
+=======
 			sh 'curl "${BUILD_URL}/consoleText" > /tmp/test.txt'
+>>>>>>> 5518cc11c8ddaf2485f2e6e569815856ea1619fc
       }
       changed {
         echo 'things were different before...'