Hi,

I'm working on my first Jenkins plugin. I'm using the Jenkins Ruby API. The 
idea of the plugin is to archive the bundler Gemfile.lock for a ruby project 
and have Jenkins show you how it changed between builds.

I've got the first part of this working (archiving Gemfile.lock) using a 
subclass of Jenkins::Tasks::Publisher. It was very easy -- the development 
environment for ruby plugins (`jpi server`, etc.) is great. 

Now I'm trying to add the action which will display the differences. I can't 
find any examples of using actions from the ruby plugin API, except for an 
example of a root action in the documentation for 
Jenkins::Plugin#register_extension. Since the action is build-related, I don't 
think that register_extension is the right point. As I said, though, I'm 
completely new to Jenkins plugin development so I may be going at this the 
wrong way. I've been trying variations on this:

   def perform(build, launcher, listener)
     # ...
     build.native.add_action(Jenkins::Plugin.instance.export(my_action))
   end

If my_action is a subclass of Jenkins::Model::RootAction, the build is not 
serializable. If my_action just mixes in Jenkins::Model::Action, I get an 
"unable to find suitable Java Proxy" during the build. I'm using ruby-runtime 
0.4, jpi 0.3.3, and jenkins-ruby-runtime 0.1.26.

Are actions supported from the ruby API? If so, can someone give me a pointer 
on how to construct and add one? (Or if I'm completely misunderstanding what 
actions are for, a suggestion to go re-read the documentation would be 
appreciated.)

Thanks,
Rhett


Reply via email to