fix(hermes-triage-demo): correct groovy escape depth for newline join and shell JSON quotes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jenkins 2026-08-05 16:59:27 -03:00
parent 48fff25915
commit 8a5c93ac2f

View File

@ -533,10 +533,10 @@ data:
' fi',
' STATE=$(cat "$STATE_FILE")',
' if [ "$STATE" = "healthy" ]; then',
' echo "{\\"event\\":\\"hermes_demo_test_pass\\",\\"incident_id\\":\\"$INCIDENT_ID\\",\\"message\\":\\"fixture state healthy\\"}"',
' echo "{\\\\"event\\\\":\\\\"hermes_demo_test_pass\\\\",\\\\"incident_id\\\\":\\\\"$INCIDENT_ID\\\\",\\\\"message\\\\":\\\\"fixture state healthy\\\\"}"',
' exit 0',
' fi',
' echo "{\\"event\\":\\"hermes_demo_test_failure\\",\\"incident_id\\":\\"$INCIDENT_ID\\",\\"classification_hint\\":\\"demo_fixture_unhealthy\\",\\"message\\":\\"expected fixture state healthy; found $STATE\\"}"',
' echo "{\\\\"event\\\\":\\\\"hermes_demo_test_failure\\\\",\\\\"incident_id\\\\":\\\\"$INCIDENT_ID\\\\",\\\\"classification_hint\\\\":\\\\"demo_fixture_unhealthy\\\\",\\\\"message\\\\":\\\\"expected fixture state healthy; found $STATE\\\\"}"',
' exit 1',
' volumeMounts:',
' - name: fixture',
@ -553,7 +553,7 @@ data:
' persistentVolumeClaim:',
' claimName: hermes-triage-demo-fixture'
]
writeFile file: 'test-runner-job.yaml', text: manifest.join('\n') + '\n'
writeFile file: 'test-runner-job.yaml', text: manifest.join('\\n') + '\\n'
sh 'kubectl -n hermes-triage-demo create -f test-runner-job.yaml'
def verdict = 'unknown'
timeout(time: 3, unit: 'MINUTES') {