use*_*281 5 curl jira jenkins jenkins-declarative-pipeline
我正在尝试从 Jenkins 声明式管道执行curl post 命令,但是,它抛出语法错误 - Expecting '}' find ':'
管道脚本如下:
pipeline {
agent { label ' Linux01'}
stages {
stage('Hello') {
steps {
sh 'curl -u username:password -X POST -d '{"body":"Jenkinspipleinecomment"}' -H "Content-Type:application/json" http://localhost:8080/rest/api/2/issue/someissue/comment'
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
请帮忙。
试试这个
pipeline {
agent { label ' Linux01'}
stages {
stage('Hello') {
steps {
sh """curl -u username:password -X POST -d '{"body":"Jenkinspipleinecomment"}' -H "Content-Type:application/json" http://localhost:8080/rest/api/2/issue/someissue/comment"""
}
}
} }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16351 次 |
| 最近记录: |