Reputation: 19692
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.
Upvotes: 5
Views: 1367
Reputation: 1
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}
Upvotes: 0
Reputation: 516
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.
Upvotes: 1
Reputation: 2524
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. ;)
Upvotes: 0