Is there a way to kill a build in drone before it finishes or times out?
The default timeout in drone is 6 hours (https://github.com/drone/drone/blob/master/cmd/drone/drone.go#L32)
And if you have a mistake in your makefile that just get's stuck then you need to wait for 6 hours.
This is specially annoying if you have limited number of simultaneous builds.
My question is about the self hosted, open source version, not the hosted version if it makes any difference.
Asked
Active
Viewed 1,211 times
5

Brad Rydzewski
- 2,523
- 14
- 18

Ali
- 18,665
- 21
- 103
- 138
4 Answers
1
You can stop drone build using CLI:
drone build stop <repo/name> <build>
If build cannot be stopped/canceled, you can kill it:
drone build kill <repo/name> <build>
See more commands in drone CLI docs.

Domas
- 496
- 1
- 6
- 16
0
I just pushed a new commit and it automatically stopped the stuck build and started a new one. No need to wait for 6 hours. ;)

Rafael Beckel
- 2,199
- 5
- 25
- 36
0

dontmentionthebackup
- 2,775
- 1
- 21
- 18
-
1has this been removed in the latest version? – sabrehagen Feb 03 '18 at 07:56
-
1@sabrehagen yes I think so. – krisanalfa Mar 12 '18 at 07:22
0
To stop the build using the drone cli, use the following command:
drone build stop <root/name> <DRONE_BUILD_NUMBER>
Make sure the following are exported:
export DRONE_SERVER=https://drone.server.com
export DRONE_TOKEN=<secret_drone_token>
It is also possible to stop the build using API:
DELETE /api/repos/{owner}/{repo}/builds/{build}

Jasmine Baral
- 1
- 1