I've read a lot here and then but still cannot find how to fix this:
steps.wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
steps.withCredentials([steps.usernamePassword(credentialsId: "test", usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
steps.sh """
curl --silent -u \${GIT_USERNAME}:\${GIT_PASSWORD} -H "Content-Type: application/json" -X POST https://some.url --data-binary @- <<-EOF
{
"state": "$STATE",
"key": "\$JOB_NAME",
"name": "\$BUILD_TAG",
"url": "\$BUILD_URL",
"description": "$DESCRIPTION"
}
EOF"""
This resides in jenkins shared library. I've read that I have to avoid whitespaces, but I don't see what whitespaces I've created here. I keep receiving this error:
line 11: warning: here-document at line 2 delimited by end-of-file (wanted `EOF')
steps.sh """I'm pretty sure you need to use escape characters here, like:steps.sh "\""