yanis
yanis

Reputation: 333

Restrict given Jenkins jobs from being manually aborted

The use case I am trying to solve is preventing developers from cancelling/stopping running build/s in Jenkins. The need for this is provoked by that these jobs run Terraform scripts which execute plan and apply steps, locking terraform state in our backends. If a job is aborted there are some race conditions which prevent the unlocking of the tf-state which causes numerous issues further on.

The ideal solution will be even after the user cancels the running Jenkins job the shell terraform script to continue running(in background) until completion.

Alternative solution can be having an option/plugin using which we can restrict the manual interventions on specified jobs. Meaning that the Jenkins administrator can specify which jobs cannot be cancelled manually by regular users.

Has anyone faced this problem before? And what approach have you taken to solve it? Any ideas will be appreciated.

Upvotes: 0

Views: 1022

Answers (1)

piyush sachdeva
piyush sachdeva

Reputation: 456

Updated

You can use role-based strategy plugin, and create different roles as per your requirements and user group(active directory groups) , assign the roles to relevant group and you should be good.

I believe the plugin documentation is old, I can see job cancel option in my Jenkins box, please see below screenshot

Manage Roles

Upvotes: 2

Related Questions