【发布时间】:2018-02-15 08:37:30
【问题描述】:
在 Jenkins 管道中,我无法嵌入环境变量:
sh 'curl -d '{"color":"green","message":"${BUILD_NUMBER}","notify":false,"message_format":"text"}' -H 'Content-Type: application/json' http:blahbah.com'
问题是即使我尝试在每个 ' 和 " 前面使用转义字符 \ 时,目标机器上的输出总是 ${BUILD_NUMBER}
这里应该如何看待正确的 curl 语法?
【问题讨论】:
标签: curl jenkins environment-variables jenkins-pipeline