Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling and enabling jobs in jenkins

Currently in order to enable or disable a job, a user must have Job Configure permissions in the Matrix-based security configuration.We would like to be able to manage the enable / disable job permission independently from the job configure permission. There are some nightly jobs that we want every user to be able to enable and disable the project without touching/breaking the configuration.

Thanks

like image 212
chanukhya bachina Avatar asked Oct 25 '25 20:10

chanukhya bachina


1 Answers

Provide a script for the users that will do this using the credentials of 'root' user and set only the execute bit on the script so that no one can read/copy it.

At least 3 ways to make a script:

HTTP POST request:

1.

curl -X POST http(s)://<your_jenkins_url>/jenkins/job/<nightly-build_job_name>/disable

2.

Use python JenkinsAPI. Documentation is very good, easy to understand much like the API.

3.

The third one can be a script which will use jenkins-cli: accepted answer describes this well .

like image 72
Zloj Avatar answered Oct 28 '25 21:10

Zloj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!