From 056cb4f2a31a951786b2b074c9f78a4e2f5c1793 Mon Sep 17 00:00:00 2001 From: adam Date: Wed, 27 Nov 2024 15:39:21 -0500 Subject: [PATCH] jq: parsed after banging my head against it for long enough, the jq parse that i'm 100% convinced worked in test doesn't work, so I was able to work against that. --- scripts/1clickservice.groovy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/1clickservice.groovy b/scripts/1clickservice.groovy index 002c166..14e0393 100644 --- a/scripts/1clickservice.groovy +++ b/scripts/1clickservice.groovy @@ -83,9 +83,10 @@ pipeline { while [ -z "\$strRes" ]; do sleep 5; - strRes=\$(curl -X GET -s -u ${env.JENKINS_USR}:'${env.JENKINS_PSW}' \ - alloces.lan:8080/job/gitea.arg.rip/api/json \ - | jq ".jobs.[] | select(.name==\"${env.servicename}\")") + curl -X GET -s -u ${env.JENKINS_USR}:'${env.JENKINS_PSW}' \ + alloces.lan:8080/job/gitea.arg.rip/api/json > f.json + strRes=\$(jq '.jobs' f.json | jq '.[] | select(.name==\"${env.servicename}\")') + rm f.json done """ }