I'm trying to start a build that's already running (see output below), but drone just returns the standard JSON response from the running build and doesn't start the new build, even when trying to fork - is there a way to trigger another build from the current build?
So far I have tried using the GO and JS wrappers to no avail, and below is a log of trying directly curl
ing the REST API (it gives more of a response, but still doesn't trigger a new build):
ipeline:
deploy:
image: repo/my-deploy:latest
secrets:
- ...
commands:
- export DRONE_DEPLOY_TO="$${DRONE_DEPLOY_TO:-dev}"
- ./entrypoint.sh
when:
event: [deployment, push]
branch: master
some_slack_notify_jobs:
...
promote_to_uat:
image: repo/my-deploy:latest
secrets:
- drone_token
commands:
- curl "https://$${DRONE_SERVER}/$${REPO_PATH}/builds/$${DRONE_BUILD_NUMBER}?fork=true&DRONE_DEPLOY_TO=uat&access_token=$${DRONE_TOKEN}"
when:
branch: master
event: push
status: success
...succeeds but doesn't trigger the new build, just exits cleanly with the following output:
curl ...
{
"id":6027,
"number":69,
"parent":0,
"event":"push",
"status":"running",
"error":"",
"enqueued_at":1517420554,
"created_at":1517420554,
"started_at":1517420554,
"finished_at":0,
"deploy_to":"",
"commit":"44be60f0d5d223e550f7116e1d36a3f44592dc65",
"branch":"master",
"ref":"refs/heads/master",
"refspec":"",
"remote":"",
"title":"",
"message":"Merge branch 'feature/...' into 'master'",
"timestamp":0,
"sender":"",
"author":"Robin Knipe",
"author_avatar":"...",
"author_email":"...",
"link_url":"",
"signed":false,
"verified":true,
"reviewed_by":"",
"reviewed_at":0,
"procs":[
{
"id":20796,
"build_id":6027,
"pid":1,
"ppid":0,
"pgid":1,
"name":"",
"state":"running",
"exit_code":0,
"start_time":1517420554,
"machine":"drone-agent-gitlab-3964423023-6m5mv",
"children":[
{
"id":20797,
"build_id":6027,
"pid":2,
"ppid":1,
"pgid":2,
"name":"default",
"state":"success",
"exit_code":0,
"start_time":1517420554,
"end_time":1517420569,
"machine":"drone-agent-gitlab-3964423023-6m5mv"
},
{
"id":20798,
"build_id":6027,
"pid":3,
"ppid":1,
"pgid":3,
"name":"deploy",
"state":"success",
"exit_code":0,
"start_time":1517420569,
"end_time":1517420604,
"machine":"drone-agent-gitlab-3964423023-6m5mv"
},
{
"id":20799,
"build_id":6027,
"pid":4,
"ppid":1,
"pgid":4,
"name":"notify_slack_success_push",
"state":"success",
"exit_code":0,
"start_time":1517420605,
"end_time":1517420606,
"machine":"drone-agent-gitlab-3964423023-6m5mv"
},
{
"id":20800,
"build_id":6027,
"pid":5,
"ppid":1,
"pgid":5,
"name":"notify_slack_failure_push",
"state":"pending",
"exit_code":0
},
{
"id":20801,
"build_id":6027,
"pid":6,
"ppid":1,
"pgid":6,
"name":"promote_to_uat",
"state":"running",
"exit_code":0,
"start_time":1517420606,
"machine":"drone-agent-gitlab-3964423023-6m5mv"
}
]
}
]
}
exit code 0