End-to-End example using Jenkins 2.0.x Cookbook? / Enabling Authentication


#1

I can not figure out how to have the current Jenkins Community Cookbook https://github.com/opscode-cookbooks/jenkins/ do the equivalent of the clicking the button on the Web Interface Configure Global Security->Enable Security.

Is there a way to do that programmatically and with one of the resources in the new Jenkins cookbook?

I was able to use the examples to create an admin user but can’t find even the groovy or java way to do that. (My mind does have a mental block at looking at Java api docs so that could be the problem too, but I’ve done a lot of googling and can’t seem to find it)

More generally it would be wonderful if someone had a blog post or some other doc that shows how to use the new Jenkins 2.0.x cookbook to build a functioning Jenkins server with authentication without having to do anything with the Web UI. Ideally it would be good enough for someone who is not an expert in Jenkins/Groovy/Java. All the examples I could find were using the pre 2.0.x version of the cookbook.

Thanks!
Rob


Robert J Berger +1 408-838-8896
Internet Bandwidth Development, LLC
http://www.linkedin.com/in/rberger


#2

You need to find what Groovy the WebUI maps to. The easiest way is to look at the Jenkins source code. Everything that happens in the WebUI goes through Stapler, which just executes the correct Java.

Thanks,
Seth

On Mar 19, 2014, at 6:51 PM, Robert J Berger rberger@ibd.com wrote:

I can not figure out how to have the current Jenkins Community Cookbook https://github.com/opscode-cookbooks/jenkins/ do the equivalent of the clicking the button on the Web Interface Configure Global Security->Enable Security.

Is there a way to do that programmatically and with one of the resources in the new Jenkins cookbook?

I was able to use the examples to create an admin user but can’t find even the groovy or java way to do that. (My mind does have a mental block at looking at Java api docs so that could be the problem too, but I’ve done a lot of googling and can’t seem to find it)

More generally it would be wonderful if someone had a blog post or some other doc that shows how to use the new Jenkins 2.0.x cookbook to build a functioning Jenkins server with authentication without having to do anything with the Web UI. Ideally it would be good enough for someone who is not an expert in Jenkins/Groovy/Java. All the examples I could find were using the pre 2.0.x version of the cookbook.

Thanks!
Rob


Robert J Berger +1 408-838-8896
Internet Bandwidth Development, LLC
http://www.linkedin.com/in/rberger