Jenkins module: how to set up a post-build action?

asked 2015-05-21 09:08:55 -0600

RizzoV gravatar image

updated 2015-05-21 09:09:17 -0600

Hello, I'm using the official puppet-jenkins module and it's working flawlessly, I configured a job and it goes well but now I need to set up a post-build action and I don't know how to do it. What I need to do is to deploy my build to a Tomcat instance, I already configured Puppet to make Jenkins download and install the Deploy plugin, wich works well when I set it up manually, but I have no idea how to make the configuration of the plugin automatic through Puppet. Can you help me with that? Thanks in advance.

edit retag flag offensive close merge delete


What do you mean with "I already configured Puppet to make Jenkins download and install the Deploy plugin"? Have you got something like "jenkins::plugin { 'deploy': }"?

giavac gravatar imagegiavac ( 2015-05-22 06:26:00 -0600 )edit

Yep, I've had problems with making it visible as enabled by Jenkins but after editing some files now seems that everything works fine. The only problem is that I don't know how to add the post-build action.

RizzoV gravatar imageRizzoV ( 2015-05-22 07:36:45 -0600 )edit

I suspect the puppet module is not able to do that directly, but I'd suggest to check whether the manual setting generates (or changes) an .xml file. If that's the case, then perhaps you could include a file resource with that content after the jenkins::plugin resource.

giavac gravatar imagegiavac ( 2015-05-22 08:02:47 -0600 )edit

Thank you, I'll try and report.

RizzoV gravatar imageRizzoV ( 2015-05-25 05:08:24 -0600 )edit

I've been able to do it as you suggested. Every setting in a job generates a changement in the config.xml file. Forcing Puppet to create this file with the same content as the one generated when setting the job up manually permits to have the job "configured by Puppet". Thank you!

RizzoV gravatar imageRizzoV ( 2015-05-26 08:45:07 -0600 )edit