Надеюсь, следующий пример поможет вам. Есть 2 примера запросов PUT
и PATCH
. PATCH
изменяет результат этапа и PUT
перезапускает его. Ожидается, что будет запущен дополнительный конвейер - в моем случае он ждет 5 секунд и проверяет входной параметр.
{
"expectedArtifacts": [],
"keepWaitingPipelines": false,
"limitConcurrent": true,
"parameterConfig": [
{
"default": "false",
"description": "",
"hasOptions": false,
"label": "success",
"name": "success",
"options": [
{
"value": "false"
},
{
"value": ""
}
],
"pinned": false,
"required": true
}
],
"stages": [
{
"completeOtherBranchesThenFail": false,
"continuePipeline": false,
"failPipeline": false,
"method": "PUT",
"name": "PUT",
"payload": {
"continuePipeline": false,
"failPipeline": true
},
"refId": "3",
"requisiteStageRefIds": [
"7"
],
"stageEnabled": {
"expression": "(#stage('Pipeline')).toString == 'TERMINAL'",
"type": "expression"
},
"statusUrlResolution": "getMethod",
"type": "webhook",
"url": "http://spin-gate:8084/pipelines/${execution.id}/stages/${#stage('Pipeline').id}/restart",
"waitForCompletion": false
},
{
"name": "Wait 2",
"refId": "5",
"requisiteStageRefIds": [
"3",
"6"
],
"type": "wait",
"waitTime": 5
},
{
"application": "ads-demo-app",
"completeOtherBranchesThenFail": false,
"continuePipeline": true,
"failPipeline": false,
"name": "Pipeline",
"pipeline": "d7c5d33c-c250-48d8-a7c3-5e0a951bb806",
"pipelineParameters": {
"success": "false"
},
"refId": "6",
"requisiteStageRefIds": [],
"type": "pipeline",
"waitForCompletion": true
},
{
"method": "PATCH",
"name": "PATCH",
"payload": {
"continuePipeline": false,
"failPipeline": true,
"pipelineParameters": {
"success": "true"
}
},
"refId": "7",
"requisiteStageRefIds": [
"6"
],
"statusUrlResolution": "getMethod",
"type": "webhook",
"url": "http://spin-gate:8084/pipelines/${execution.id}/stages/${#stage('Pipeline').id}"
}
],
"triggers": [],
}