ソースを参照

try GetLog function

vmshay 5 年 前
コミット
b2e20459fc
1 ファイル変更14 行追加0 行削除
  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...'