Is is possible to disable Jenkins CLI over Remoting option via Groovy script? I want to put the script into init.groovy.d so that is option is disabled upon start up so I am not prompted to disable it
Thanks
Create the file $JENKINS_HOME/jenkins.CLI.xml
with the following content:
<?xml version='1.0' encoding='UTF-8'?>
<jenkins.CLI>
<enabled>false</enabled>
</jenkins.CLI>
It will behave as if you pressed the "Disable Jenkins CLI over Remoting" button in the Jenkins GUI once the server restarts.
juhnz's answer covers disabling the CLI completely. However, I believe the intent of the question was just disable the Jenkins CLI over remoting, only, but otherwise enable the CLI.
you can do it like this (jenkins2.60.2)
import jenkins.model.Jenkins
jenkins.model.Jenkins.instance.getDescriptor("jenkins.CLI").get().setEnabled(false)
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With