Reputation: 346
We have a database tester build that first clones a database before it runs the tests. We would like to prevent this build from being stopped/cancelled by a user. The problem is, if the build is cancelled/stopped manually during the cloning process it leaves the DB in a bad way and requires DBA intervention.
Is there a way to prevent a build step from being cancelled/stopped?
Upvotes: 3
Views: 1258
Reputation: 3380
You can archive it using Roles and Permissions. The permission called "Stop build / remove from queue". So you can create a role in TeamCity without permission to stop builds and create a separate project for database cloning. Then grant users/groups with this role for the database clone project.
Upvotes: 1
Reputation: 3249
I don't think you can do that in TeamCity. The best you can do is detach the cloning process from TeamCity, so cancelling the build in TeamCity won't touch the cloning process. (E.g. use a Powershell build step which calls Start-Process myCloningProcess.exe -Wait
.)
Of course, there is a more general problem: how do you prevent the cloning process from being killed at all (e.g. by someone working on the TeamCity agent, not via the TeamCity GUI)? You can't. Hence, the solution above will only deal with the risk in the context of TeamCity; it won't solve this more general issue.
Upvotes: 1