Testing string interpolation

This commit is contained in:
andrew clark
2025-10-22 12:12:19 -06:00
parent 8e13b5f22d
commit 2e191c6c4b

10
qetest/Jenkinsfile vendored
View File

@@ -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 + '''"}'
'''
}
}
}