嘿,我想在一个很长的jenkinsfile中执行一个sh命令,分为多行。事情是我做不到。命令被执行,但只有第一行。我尝试将“ \”与“ +”一起使用,但是我无法执行Hole命令。这就是我现在的方式:
node {
stage('purge URL content in cloudflare') {
sh """\
curl -X GET "https://api.cloudflare.com/client/v4/zones/cd7d030xxxxxxx420df9514dad0" +
-H "X-Auth-Email: mail.user@domain.com" +
-H "X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
-H "Content-Type: application/json" +
--data '{"files":["${params.URL1}",{"url":"${params.URL2}","headers":{"Origin":"cloudflare.com","CF-IPCountry":"US","CF-Device-Type":"desktop"}}]}' """
}
}
您可以在多行中添加一个命令的习惯如何?
答案 0 :(得分:0)