Go-CD:如何使用API来触发管道



是否有API可以用来触发管道,我在API手册中没有找到。或者,有没有其他方法可以使用linux命令触发管道?

感谢

文档链接:https://api.gocd.org/current/#scheduling-管道

POST /go/api/pipelines/:pipeline_name/schedule

在请求中,您可以覆盖环境变量、要使用的材质,并选择在开始之前更新材质。

从文档中获取的命令示例:

$ curl 'https://ci.example.com/go/api/pipelines/pipeline1/schedule' 
-u 'username:password' 
-H 'Accept: application/vnd.go.cd.v1+json' 
-H 'Content-Type: application/json' 
-X POST 
-d '{
"environment_variables": [
{
"name": "USERNAME",
"secure": false,
"value": "bob"
},
{
"name": "SSH_PASSPHRASE",
"value": "some passphrase",
"secure": true,
},
{
"name": "PASSWORD",
"encrypted_value": "YEepp1G0C05SpP0fcp4Jh+kPmWwXH5Nq",
"secure": true,
}
],
"materials": [
{
"fingerprint": "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c",
"revision": "123"
},
{
"fingerprint": "7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730",
"revision": "1058e75b18e8a645dd71702851994a010789f450"
}
],
"update_materials_before_scheduling": true
}'

/go/api/pipelines/${pipelineName}/schedule-works

最新更新