Git Product home page Git Product logo

jenkins.rb's Introduction

Jenkins.rb - Ruby tools and SDK for Jenkins

Build Status

This is the Jenkins Ruby toolkit. You can use it to build, test and release Jenkins plugins written in Ruby.

It also contains a jenkins command line tool which you can use to interact with a Jenkins server from the terminal.

Developing Ruby Plugins

Documentation for Ruby plugin development is on the wiki

jenkins.rb's People

Contributors

code-later avatar cowboyd avatar cthulhu-bot avatar cynipe avatar daddye avatar docwhat avatar dpogue avatar drnic avatar echohead avatar eitoball avatar gertthiel avatar hsbt avatar jcmuller avatar jorgenpt avatar josh-stupplebeen avatar justinweiss avatar kohsuke avatar mechamogera avatar misfo avatar nu7hatch avatar rmoriz avatar ryotarai avatar sanemat avatar stigkj avatar takai avatar textgoeshere avatar whilp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jenkins.rb's Issues

jpi commands failing

OS: Latest centOS

[jenkins@55c97e57786b buddycloud-for-jenkins]$ ruby -v
jruby 1.7.12 (1.9.3p392) 2014-04-15 643e292 on OpenJDK 64-Bit Server VM 1.7.0_55-mockbuild_2014_04_16_12_11-b00 [linux-amd64]
[jenkins@55c97e57786b buddycloud-for-jenkins]$ jpi build
Jenkins::Plugin::SpecificationNotFound: no plugin specification found in /tmp/buddycloud-for-jenkins
           find! at /usr/local/rvm/gems/jruby-1.7.12/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin/specification.rb:131
            spec at /usr/local/rvm/gems/jruby-1.7.12/gems/jpi-0.4.0/lib/jenkins/plugin/cli.rb:73
           build at /usr/local/rvm/gems/jruby-1.7.12/gems/jpi-0.4.0/lib/jenkins/plugin/cli.rb:34
             run at /usr/local/rvm/gems/jruby-1.7.12/gems/thor-0.19.1/lib/thor/command.rb:27
  invoke_command at /usr/local/rvm/gems/jruby-1.7.12/gems/thor-0.19.1/lib/thor/invocation.rb:126
        dispatch at /usr/local/rvm/gems/jruby-1.7.12/gems/thor-0.19.1/lib/thor.rb:359
           start at /usr/local/rvm/gems/jruby-1.7.12/gems/thor-0.19.1/lib/thor/base.rb:440
          (root) at /usr/local/rvm/gems/jruby-1.7.12/gems/jpi-0.4.0/bin/jpi:6
            load at org/jruby/RubyKernel.java:1081
          (root) at /usr/local/rvm/gems/jruby-1.7.12/bin/jpi:1
            eval at org/jruby/RubyKernel.java:1101
          (root) at /usr/local/rvm/gems/jruby-1.7.12/bin/jruby_executable_hooks:15

Post Build Action Not Saving After Restart

Post build actions, both dependent on ruby-runtime and not, are not saving post build actions after a restart of Jenkins.

This issue occurs on the unreleased master branch. Believe it may be due to the upgrade in JRuby version. It has been observed on the following operating systems: Ubuntu, CentOS, Mac OS X, and Windows Server 2012.
Steps to reproduce:

  1. Build the plugin from the master branch
  2. Install plugin to Jenkins
  3. Select the Email post build action in a dummy job
  4. Save the job
  5. Go back in and you will see the post build action parameters are still there
  6. Restart Jenkins
  7. Go into the job and you will see the post build action is no longer there

job command doesn't seem to use --xml properly

No error, just doesn't seem to support the --xml option properly

14:37:42 tyler@kiwi flexd master ? jenkins job charon --xml
ERROR: Select an output format: --json, --xml, --yaml, --hash
14:37:46 tyler@kiwi flexd master ? jenkins job charon --json
{"name":"charon","actions":[{},{},{},{}], etc etc etc
14:37:49 tyler@kiwi flexd master ?

Console

Would be nice to see console log:

jenkins console job-name => will show /job/job-name/lastBuild/consoleText
jenkins console job-name 18 => will show /job/job-name/18/consoleText

chef-solo compatible node_ssh

Would be nice to create jenkins master and ssh nodes using chef-solo recipes. Currently these break due to relying on search. Intermediate, special use case, could be a node_vagrant_ssh recipe

Global Plugin Configuration

Hey,

while fields from a template called global.erb are displayed on Jenkins' global configuration page, I could not yet figure out how to persist or access information given in those fields.

Any input would be greatly appreciated.

Cheers
Tim

auth for remote hudson

I'm trying to use jenkins.rb as an API to a remote jenkins server and am having a bit of trouble - how do you tell jenkins.rb the auth details for your server?

it is entirely possible that i am attempting to drive in a nail with a corkscrew here - is jenkins.rb intended to be used as a remote API?

Load job steps template from file or URI

It would be handy to be able to supply a file or URI to use as the job steps config template.

Existing builtin templates would be untouched: if the parameter to --template option is one of VALID_JOB_TEMPLATES then the config is built as per usual.

However if the parameter is not one of VALID_JOB_TEMPLATES, then new behaviour occurs. If the parameter looks like a URI, the content of the response is used. Otherwise, it's assumed to be the file, and the file contents are used.

Scenario: Create job with steps from file (jenkins create --template mytemplate.xml)
Scenario: Create job with steps from URI (jenkins create --template http://example.com/template)

Happy to contribute code if there's an appetite for this.

Ruby Runtime 0.12 + Jenkins 1.598 and Above Not Saving Job Parameters

Hello,

In Jenkins 1.598 and greater + ruby-runtime 0.12 job configs are no longer saving for plugins that use the ruby-runtime plugin. Env is Mac OS X Yosemite.

Steps to Reproduce:

  1. Using a Jenkins >= 1.598
  2. Install the Yammer plugin.
  3. Create a test job
  4. Add Yammer as a Post Build Action, put some string in the field
  5. Save the job
  6. Go back into the job and you will see that the Post Build Action has not saved. If you open the job config.xml you will also observe that the publisher is not getting written.

This has also been observed in the Chef plugin, which also appears to rely on the ruby-runtime plugin (see open issue: melezhik/chef-plugin#4 ).

Getting error with a simple generator

    Loading /home/rauhryan/lecode/ruby/sabatoast/models/mongodb_publisher.rb
    ArgumentError: wrong number of arguments (2 for 1)
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:116:in `register_extension'
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:135:in `register_describable'
    org/jruby/RubyProc.java:268:in `call'
    org/jruby/RubyProc.java:228:in `call'
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:250:in `callback'
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:245:in `fire'
    org/jruby/RubyArray.java:1602:in `each'
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:244:in `fire'
    /home/rauhryan/.rvm/gems/jruby-1.6.5.1/gems/jenkins-plugin-runtime-0.1.27/lib/jenkins/plugin.rb:148:in `start'
    Apr 2, 2012 10:43:47 AM jenkins.InitReactorRunner$1 onAttained
    INFO: Prepared all plugins
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Apr 2, 2012 10:43:49 AM jenkins.InitReactorRunner$1 onAttained

I'm getting an argument error when I generate a publisher that just prints "Hello world" in the perform method.

Perhaps I'm doing something wrong?

0.3.1 doesn't depend on json, and dies with require error

Steps to reproduce:

  1. Take a completely clean gem install (I tested on a 64 bit lucid server install)
  2. $ gem install hudson
  3. $ hudson

What I expected:

A help or missing command message printed out from the ruby script called hudson.

What actually happened:

ubuntu@srv-rt06o:~$ sudo gem install hudson
Building native extensions.  This could take a while...
When you HTTParty, you must party hard!
Building native extensions.  This could take a while...
Successfully installed term-ansicolor-1.0.5
Successfully installed yajl-ruby-0.7.8
Successfully installed crack-0.1.8
Successfully installed httparty-0.6.1
Successfully installed builder-2.1.2
Successfully installed thor-0.14.4
Successfully installed hpricot-0.8.3
Successfully installed hudson-0.3.1
8 gems installed

ubuntu@srv-rt06o:~$ hudson
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- json (LoadError)

Installing the json gem by hand solved it and hudson runs perfectly on that box now.

hudson is failing with thor version 0.13.8

When I have thor version 0.13.8 installed (which is loaded by hudson 0.2.5.pre as it has dependency on thor ~> 0.13.6) then when I do "hudson -v" then I get error

.../gems/thor-0.13.8/lib/thor.rb:291:in `help': wrong number of arguments (2 for 1) (ArgumentError)

If I uninstall thor version 0.13.8 and install 0.13.6 then everything works. But I need to have latest version of thor as Rails 3 depends on it.

Simple fix would be to list thor dependency in gemspec as "= 0.13.6"

Could not find a valid gem 'jenkins'

gem install jenkins

ERROR: Could not find a valid gem 'jenkins' (>= 0) in any repository
ERROR: Possible alternatives: jenkins

ruby -v

ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]

Jenkins complains about missing plugins

Hi. I am new to jenkins.rb - so perhaps its my fault, but with a default installation (gem install jenkins) - I cannot play through the tutorials because the Git and Ruby Plugin of jenkins is missing:

WARNING: Failed to resolve class
com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.plugins.ruby.Ruby : hudson.plugins.ruby.Ruby

Everything works fine if I install the plugins manually via the Jenkins web frontend.

Am I missing something here?

Creating the gem

What tool/steps are you using to generate the rubygem gem? i.e. what is the .gemified file?

hudson gem dependency prevents install in jruby 1.5.1

Observation:
iMac-007:online glongman$ gem install hudson
Building native extensions. This could take a while...
ERROR: Error installing hudson:
ERROR: Failed to build gem native extension.

    /Users/glongman/.rvm/rubies/jruby-1.5.1/bin/jruby extconf.rb
    WARNING: JRuby does not support native extensions or the `mkmf' library.
             Check http://kenai.com/projects/jruby/pages/Home for alternatives.
    extconf.rb:5: undefined method `<<' for nil:NilClass (NoMethodError)


    Gem files will remain installed in /Users/glongman/.rvm/gems/jruby-1.5.1/gems/yajl-ruby-0.7.8 for inspection.
    Results logged to /Users/glongman/.rvm/gems/jruby-1.5.1/gems/yajl-ruby-0.7.8/ext/gem_make.out

Question: We're exploring building our project using hudson. Our products are deployed as war files w/warbler. Many of our tests must run in jruby. Are we screwed?

Broken Jenkins::Model::Listener

Im using jenkins-plugin-runtime 0.2.3 with ruby-runtime 0.12, and it seems that the Listener class is broken. It seems that the class tries to use the native ruby logger object, but Logger get somewhere masked with the java Logger class. If I comment out

@level = Logger::DEBUG

on Listener initialize method, everything seems to works fine, although that's probably only because I never actually used that listener object.

I've discovered this when trying to implement a Jenkins notifier in ruby, and I've seen that other ruby notifiers work, although no one of them is packaged with 0.2.3+0.12 but with much earlier versions.

When prebuild method is executed I get this:

> git rev-list 495066ae2265f6f56255a140c45c5815655c80e0 # timeout=10
ERROR: uninitialized constant Java::JavaUtilLogging::Logger::DEBUG (NameError)org/jruby/RubyModule.java:2677:in `const_missing'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/model/listener.rb:15:in `initialize'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin/proxies.rb:58:in `import'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:166:in `import'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin/proxy.rb:84:in `import'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:8:in `prebuild'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:22:in `boolean_result'
/var/lib/jenkins/plugins/gitlab-hook/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:7:in `prebuild'

Plugin system for templates

Following on https://github.com/cowboyd/jenkins.rb/issues/31#issuecomment-3720385

What I propose initially is the ability to supply Ruby files that will be required at runtime by Jenkins. Users can then define and load their own templating code based on the existing Job::ConfigBuilder class.

Scenario: Create job with steps from custom template (jenkins create -r my_sweet_config_builder.rb --template my_template)

This is a similar pattern to, say, RSpec where you can load and use custom formatters at runtime.

DataBoundConstructor error

I'm trying to extend the parameterizedtrigger plugin and i'm running the the following error (below), i have my annotation set for DataBoundConstructor but something must not be set right.. Any ideas would be appreciated. thanks

Caused by: java.lang.IllegalArgumentException: Failed to convert the configs parameter of the constructor public hudson.plugins.parameterizedtrigger.BuildTriggerConfig(java.lang.String,hudson.plugins.parameterizedtrigger.ResultCondition,boolean,java.util.List)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:590)
    ... 61 more
Caused by: java.lang.IllegalArgumentException: Failed to instantiate class hudson.plugins.parameterizedtrigger.AbstractBuildParameters from {"stapler-class":"hudson.plugins.parameterizedtrigger.AbstractBuildParameters","kind":"BakeryIngredientsBuilder-IngredientsBuildParameters"}
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:596)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:632)
    at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:391)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:588)
    ... 61 more
Caused by: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class hudson.plugins.parameterizedtrigger.AbstractBuildParameters
    at org.kohsuke.stapler.ClassDescriptor.loadConstructorParamNames(ClassDescriptor.java:176)
    at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:575)
    ... 64 more

My code is this:

include Java
java_import Java.hudson.plugins.parameterizedtrigger.AbstractBuildParameters
java_import Java.org.kohsuke.stapler.DataBoundConstructor;

class IngredientsBuildParameters < AbstractBuildParameters
  include Jenkins::Model
  include Jenkins::Model::Describable

  display_name "Bakery Ingredients Parameters"
  describe_as Java.hudson.plugins.parameterizedtrigger.AbstractBuildParameters

  java_annotation "DataBoundConstructor"
  def initialize(attrs={})

  end

  #public abstract Action getAction(AbstractBuild<?,?> build, TaskListener listener)
  #            throws IOException, InterruptedException, DontTriggerException;
  def getAction(build, listener)
  end
end

Move generator templates into the runtime gem

Example: If I have a 0.3.0 runtime Builder, then the template to generate that Builder should live in
the ruby runtime gem and jpi should merely ask it to render the template. That way if the Builder interface changes, jpi will continue to work as advertized continue to generate valid code.

job command doesn't handle spaces in job names

14:49:24 tyler@kiwi flexd master ? jenkins job mash --json | wc -c
2012
14:49:28 tyler@kiwi flexd master ? jenkins job "flexd trunk" --json | wc -c
/home/tyler/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): /job/flexd trunk/api/json (URI::InvalidURIError)
        from /home/tyler/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/uri/common.rb:485:in `parse'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/httparty-0.6.1/lib/httparty/request.rb:27:in `path='
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/httparty-0.6.1/lib/httparty/request.rb:18:in `initialize'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/httparty-0.6.1/lib/httparty.rb:280:in `new'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/httparty-0.6.1/lib/httparty.rb:280:in `perform_request'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/httparty-0.6.1/lib/httparty.rb:232:in `get'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/jenkins-0.6.4/lib/jenkins/api.rb:94:in `job'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/jenkins-0.6.4/lib/jenkins/cli.rb:125:in `job'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/gems/jenkins-0.6.4/bin/jenkins:8
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/bin/jenkins:19:in `load'
        from /home/tyler/.rvm/gems/ree-1.8.7-2010.02/bin/jenkins:19
0
14:49:36 tyler@kiwi flexd master ? 

jpi release --release failing with Net::HTTPServerException: 403 "Forbidden"

jpi release --release failing with 403 error.
but jpi release for snapshot has succeed.

Environment

  • RVM : rvm 1.25.10
  • JRUBY : jruby-1.7.9
  • JPI : jpi (0.4.0)
  • OSX (Mavericks‎)

Trace

deploying as a release
Generating POM
Net::HTTPServerException: 403 "Forbidden"
      error! at /Users/sunggun/.rvm/rubies/jruby-1.7.9/lib/ruby/1.9/net/http.rb:2640
       value at /Users/sunggun/.rvm/rubies/jruby-1.7.9/lib/ruby/1.9/net/http.rb:2649
check_error at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/jpi-     0.4.0/lib/jenkins/plugin/tools/release.rb:22
         run at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/jpi-0.4.0/lib/jenkins/plugin/tools/release.rb:63
     release at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/jpi-0.4.0/lib/jenkins/plugin/cli.rb:55
         run at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/thor-0.18.1/lib/thor/command.rb:27
invoke_command at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/thor-0.18.1/lib/thor/invocation.rb:120
    dispatch at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/thor-0.18.1/lib/thor.rb:363
       start at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/thor-0.18.1/lib/thor/base.rb:439
      (root) at /Users/sunggun/.rvm/gems/jruby-1.7.9/gems/jpi-0.4.0/bin/jpi:6
        load at org/jruby/RubyKernel.java:1099
      (root) at /Users/sunggun/.rvm/gems/jruby-1.7.9/bin/jpi:1
        eval at org/jruby/RubyKernel.java:1119
      (root) at /Users/sunggun/.rvm/gems/jruby-1.7.9/bin/jruby_executable_hooks:15

During CI - No such file or directory - var/jenkins/jobs/ruby/config.xml

When the jenkins.rb feature suite runs in CI (both http://ec2-184-73-167-68.compute-1.amazonaws.com/job/jenkins.rb/4/console & http://jenkins.thefrontside.net/job/jenkins.rb/35/console) the features/manage_jobs.feature:47 feature fails with:

 No such file or directory - /data/jenkins-ci/jobs/jenkins.rb/workspace/var/jenkins/jobs/ruby/config.xml (Errno::ENOENT)
      ./features/step_definitions/jenkins_steps.rb:106:in `read'
      ./features/step_definitions/jenkins_steps.rb:106:in `/^the job "([^"]*)" config "([^"]*)" should be:$/'
      features/manage_jobs.feature:52:in `And the job "ruby" config "scm" should be:'

When the same scenario is run directly within a console on the CI server it works:

$ bundle exec rake jenkins:server:test &
$ bundle exec cucumber features/manage_jobs.feature:47

ERROR: uninitialized constant Java::JavaUtilLogging::Logger::DEBUG (NameError)

Démarré par l'utilisateur anonymous
Building in workspace /home/nicolas/PROJECTS/jenkins-mysql-job-databases-plugin/work/workspace/test
ERROR: uninitialized constant Java::JavaUtilLogging::Logger::DEBUG (NameError)
org/jruby/RubyModule.java:2677:in `const_missing'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/model/listener.rb:15:in `initialize'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/plugin/proxies.rb:58:in `import'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/plugin.rb:166:in `import'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/plugin/proxy.rb:84:in `import'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/tasks/build_step_proxy.rb:8:in `prebuild'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/tasks/build_step_proxy.rb:22:in `boolean_result'
/home/nicolas/.rvm/gems/jruby-1.7.17/bundler/gems/jenkins.rb-3dd944f5c85d/ruby-runtime/lib/jenkins/tasks/build_step_proxy.rb:7:in `prebuild'

[FEATURE] Allow project-specific `jenkinsrb-config.json`

I'm looking to package up a repo that will give collaborators everything they need to spin up a CI infrastructure in the cloud (for developing with the Drupal CMS). In theory, it will makes sense to have one per project.

Do you see value in this?

What would you think about checking an ENV variable called JENKINSRB_HOME before falling back on HOME?
https://github.com/jenkinsci/jenkins.rb/blob/master/ruby-tools/cli/lib/jenkins/config.rb#L24

Or is there a better way you'd rather I approach it from?

Thanks for hearing me out!

jpi release --release pushes plugins to wrong place?

Hi! According to jenkins.trb docs (https://github.com/jenkinsci/jenkins.rb/wiki/Getting-Started-With-Ruby-Plugins#wiki-sharing-your-plugin-with-the-community)

$ jpi release --release 
bundling...
Using json (1.7.7) 
Using slop (3.0.4) 
Using jenkins-plugin-runtime (0.2.3) 
Using logger (1.2.8) 
Using term-ansicolor (1.1.1) 
Using simple_console (0.0.1) from git://github.com/melezhik/simple_console.git (at master) 
Using bundler (1.3.2) 
Your bundle is complete! It was installed into ./pkg/vendor/gems
chef plugin 0.0.6 built to pkg/chef.hpi
deploying as a release
Generating POM
Uploading pkg/chef.hpi
See http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/ruby-plugins/chef/0.0.6

According https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins new pligins should appear at http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/ which is not http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/ruby-plugins/

So I just need that my plugin would be listed at official jenkins repository to be installed via jenkins server GUI

Please release 0.11 to fix JENKINS-18311

Starting from Jenkins 1.518, Jenkins fails to load ruby-runtime (java-runtime) by the error described in JENKINS-18311. This problem breaks all the plugins depending on ruby-runtime, including rvm, rbenv, etc.

I tested ruby-runtime at yyuu/jenkins.rb@65be621 on my Jenkins 1.518 and it seems fine for me. Please release new version 0.11.

Travis CI link broken in README

The readme has a link to Travis CI that doesn't work: There is no such project in Travis.

If you do put jenkins.rb on travis, you can create a button like this:

[![Build Status](https://secure.travis-ci.org/cowboyd/jenkins.rb.png)](http://travis-ci.org/cowboyd/jenkins.rb)

ruby-runtime 0.11 completely breaks RVM

Indicating a ruby to build with via the RVM plugin results in:

Started by user anonymous
Building in workspace /u/jenkins/jobs/test/workspace
FATAL: (NameError) no method 'write' for arguments (org.jruby.RubyString) on Java::JavaIo::PrintStream
  available overloads:
    (int)
    (byte[])
org.jruby.exceptions.RaiseException: (NameError) no method 'write' for arguments (org.jruby.RubyString) on Java::JavaIo::PrintStream
  available overloads:
    (int)
    (byte[])
    at RUBY.<<(/u/jenkins/plugins/rvm/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.1.17/lib/jenkins/model/listener.rb:32)
    at RUBY.setup(/u/jenkins/plugins/rvm/WEB-INF/classes/models/rvm_wrapper.rb:28)
    at RUBY.setUp(/u/jenkins/plugins/rvm/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.1.17/lib/jenkins/plugin/proxies/build_wrapper.rb:18)

Downgrading to 0.10 fixes the issue.

Existing plugin fails to load with jenkins-plugin-runtime 0.2.3

When running jpi server the following traceback occurs:

Trying to load models from /home/tyler/source/github/vagrant-plugin/models
Loading /home/tyler/source/github/vagrant-plugin/models/vagrant_publisher.rb
Loading /home/tyler/source/github/vagrant-plugin/models/vagrant_builder.rb
Loading /home/tyler/source/github/vagrant-plugin/models/vagrant_wrapper.rb
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:71 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:72 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:73 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:74 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:75 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:76 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:77 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:78 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:79 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:80 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:81 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:82 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:83 warning: optional boolean argument is obsoleted
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/lockfile-2.1.0/lib/lockfile.rb:84 warning: optional boolean argument is obsoleted
ArgumentError: wrong number of arguments (2 for 1)
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:116:in `register_extension'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:135:in `register_describable'
org/jruby/RubyProc.java:258:in `call'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:250:in `callback'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:245:in `fire'
org/jruby/RubyArray.java:1612:in `each'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:244:in `fire'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:148:in `start'
ArgumentError: wrong number of arguments (2 for 1)
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:116:in `register_extension'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:135:in `register_describable'
org/jruby/RubyProc.java:258:in `call'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:250:in `callback'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:245:in `fire'
org/jruby/RubyArray.java:1612:in `each'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:244:in `fire'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:148:in `start'
ArgumentError: wrong number of arguments (2 for 1)
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:116:in `register_extension'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:135:in `register_describable'
org/jruby/RubyProc.java:258:in `call'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:250:in `callback'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:245:in `fire'
org/jruby/RubyArray.java:1612:in `each'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:244:in `fire'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:148:in `start'
ArgumentError: wrong number of arguments (2 for 1)
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:116:in `register_extension'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:135:in `register_describable'
org/jruby/RubyProc.java:258:in `call'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:250:in `callback'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:245:in `fire'
org/jruby/RubyArray.java:1612:in `each'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:244:in `fire'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:148:in `start'
ArgumentError: wrong number of arguments (2 for 1)
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:116:in `register_extension'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:135:in `register_describable'
org/jruby/RubyProc.java:258:in `call'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:250:in `callback'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:245:in `fire'
org/jruby/RubyArray.java:1612:in `each'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:244:in `fire'
/home/tyler/.rvm/gems/jruby-1.6.7@vagrant-plugin/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/plugin.rb:148:in `start'
Feb 19, 2013 9:08:43 AM jenkins.InitReactorRunner$1 onAttained

jpi new NAME failing

$ jpi new ey-deploy
"new" was called incorrectly. Call as "jpi new NAME".
$ jpi new eydeploy
"new" was called incorrectly. Call as "jpi new NAME".
$ jpi new NAME
"new" was called incorrectly. Call as "jpi new NAME".

It seems confused.

ruby-runtime failed to load w/ java version >= 1.7

Used by gitlab hook plugin etc.

Log w/ jre9

May 11, 2015 5:52:32 PM SEVERE jenkins.InitReactorRunner$1 onTaskFailed
Failed Loading plugin ruby-runtime
java.io.IOException: Failed to initialize
    at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:439)
    at hudson.PluginManager$2$1$1.run(PluginManager.java:371)
    at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
    at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
    at jenkins.model.Jenkins$7.runTask(Jenkins.java:905)
    at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
    at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
    at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
    at org.jruby.embed.internal.SingleThreadLocalContextProvider.<init>(SingleThreadLocalContextProvider.java:43)
    at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:242)
    at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:226)
    at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:192)
    at org.kohsuke.stapler.jelly.jruby.JRubyFacet.<init>(JRubyFacet.java:65)
    at ruby.RubyRuntimePlugin.registerJRubyFacet(RubyRuntimePlugin.java:39)
    at ruby.RubyRuntimePlugin.start(RubyRuntimePlugin.java:30)
    at hudson.ClassicPluginStrategy.startPlugin(ClassicPluginStrategy.java:447)
    at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:436)
    ... 9 more
Caused by: java.lang.RuntimeException: unsupported Java version: 1.9
    at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1674)
    at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1387)
    ... 19 more

jpi - views are not reloaded by "Reload Ruby plugins" button

This if flickering bug. I make changes in views/config.ern and reload plugin by "Reload Ruby plugins" button, sometimes views layout does not get reloaded.

$ jgem list

*** LOCAL GEMS ***

blockenspiel (0.4.5)
bouncy-castle-java (1.5.0146.1)
bundler (1.2.3 ruby, 1.0.22)
coderay (1.0.6)
jenkins-plugin (0.2.0, 0.1.16)
jenkins-plugin-runtime (0.2.3, 0.2.2, 0.1.27)
jenkins-war (1.475)
jpi (0.3.8)
jruby-launcher (1.0.15 java java)
jruby-openssl (0.8.2)
json (1.7.6 java, 1.7.3 java)
method_source (0.7.1)
pry (0.8.3 java)
rack (1.5.0)
rack-protection (1.3.2)
rake (0.9.2, 0.8.7)
ruby_parser (2.3.1)
rubyzip (0.9.9)
sexp_processor (3.2.0)
sinatra (1.3.4, 1.3.3)
slop (3.0.4)
thor (0.17.0)
tilt (1.3.3)
versionomy (0.4.4)


$ which ruby
/home/melezhik/.rvm/rubies/jruby-1.6.5.1/bin/ruby

jenkins info [job] command

File this under feature requests.

A jenkins info [jobname] would be very handy to list loosely the same information displayed on http://jenkins/job/jobname, e.g. latest test results, latest build times, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.