From 2e191c6c4bd65d902c1a83075eefe07609354a1a Mon Sep 17 00:00:00 2001 From: andrew clark Date: Wed, 22 Oct 2025 12:12:19 -0600 Subject: [PATCH] Testing string interpolation --- qetest/Jenkinsfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qetest/Jenkinsfile b/qetest/Jenkinsfile index b39297e402..f88eea09ac 100644 --- a/qetest/Jenkinsfile +++ b/qetest/Jenkinsfile @@ -89,13 +89,11 @@ pipeline { for (patternMap in foundPatterns) { withCredentials([string(credentialsId: 'ck_ci_errors_webhook_url', variable: 'WEBHOOK_URL')]) { - sh """ - curl -X POST '$WEBHOOK_URL' \ + sh ''' + curl -X POST "${WEBHOOK_URL}" \ -H 'Content-Type: application/json' \ - -d '{ - "text": "${statusEmoji} ${subjectPrefix}\\n\\n**${buildStatus == 'SUCCESS' ? 'Potential issue detected' : 'Build failure detected'}:**\\n\\n**Build failure detected:** ${patternMap.description}\\n\\n**Log context:**\\n```\\n${patternMap.context}\\n```\\n\\n**Job:** ${env.JOB_NAME}\\n\\n**Branch:** ${env.BRANCH_NAME ?: env.GIT_BRANCH ?: 'Unknown'}\\n\\n**Build:** #${env.BUILD_NUMBER}\\n\\n**URL:** ${env.BUILD_URL}" - }' - """ + -d '{"text": "''' + statusEmoji + " " + subjectPrefix + '''\\n\\n**''' + (buildStatus == 'SUCCESS' ? 'Potential issue detected' : 'Build failure detected') + ''':**\\n\\n**Build failure detected:** ''' + patternMap.description + '''\\n\\n**Log context:**\\n```\\n''' + patternMap.context.replace("'", "\\'") + '''\\n```\\n\\n**Job:** ''' + env.JOB_NAME + '''\\n\\n**Branch:** ''' + (env.BRANCH_NAME ?: env.GIT_BRANCH ?: 'Unknown') + '''\\n\\n**Build:** #''' + env.BUILD_NUMBER + '''\\n\\n**URL:** ''' + env.BUILD_URL + '''"}' + ''' } } }