jenkinsci / rake-plugin Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://plugins.jenkins.io/rake/
Home Page: https://plugins.jenkins.io/rake/
I'm not sure if this is an issue with system-wide rvm or if it's an issue with the latest version of rvm. I recently rebuilt my rvm install which also meant upgrading rvm. When I look in Hudson I see a list of all my Rubies (ie. ruby-1.8.7 as well as ruby-1.8.7@global). But what I do not see any longer are the other gemsets I have created.
I have confirmed that the gemsets appear and are useable when logged in as the Hudson user:
hudson@ci:src/adhearsion$ id
uid=102(hudson) gid=1001(hudson) groups=1001(hudson),102(rvm)
hudson@ci:src/adhearsion$ rvm gemset list
gemsets for ruby-1.8.7-p330 (found in /usr/local/rvm/gems/ruby-1.8.7-p330)
as21
as22
as23
global
hudson@ci:src/adhearsion$ rvm gemset use as23
Now using gemset 'as23'
hudson@ci:src/adhearsion$ rake
... normal rake output ...
What would it take to support rbenv instead of rvm? Anything?
I installed Jenkins for the first time, so this might be my fault, but when I tried to get my tests running through this plugin, they kept failing because it wasn't installing the dependencies on my Gemfile. I ended up going back to executing the job through shell and used /usr/local/rvm/bin/rvm 1.9.2 exec bundle exec rake test
.
I'd rather use the rake-plugin. Would it make sense to add a "Use bundle exec" option, or maybe do it automatically by default if a Gemfile is detected? I've looked into this a little, but I wanted to see if I was on the right path before spending any real time on it.
On my Jenkins server I have a Rails app that uses REE (using a gemset defined in a .rvmrc file). However, it never shows in the list of available Rake versions (specifically for wanting to run rake notes after a build).
Looking at some of the code, I did notice that it looks for Ruby executables called "ruby" and "jruby", only. Does this mean REE is not supported?
Rake can be scheduled on the wrong machine.
To reproduce:
echo 'task(:default) { puts
hostname; sleep 8 }' > Rakefile
Started by user Rohan McGovern
Started by user Rohan McGovern
[EnvInject] - Loading node environment variables.
Building remotely on rmcgover-ws-02 (docker) in workspace /home/jenkins/workspace/rake test
[rake test] $ /bin/sh -xe /tmp/hudson1005075034362718171.sh
+ echo 'task(:default) { puts `hostname`; sleep 8 }'
[rake test] $ /usr/bin/rake
dd8166383c1d
[rake test] $ /usr/bin/rake
dd8166383c1d
[rake test] $ /usr/bin/rake
5ea60c3d5e02
[rake test] $ /usr/bin/rake
5ea60c3d5e02
[rake test] $ /usr/bin/rake
5ea60c3d5e02
[rake test] $ /usr/bin/rake
5ea60c3d5e02
Finished: SUCCESS
I'm not too familiar with Jenkins' APIs, but to me, this code in Rake.java looks suspicious:
private Launcher getLastBuiltLauncher(AbstractBuild build, Launcher launcher, BuildListener listener) {
AbstractProject project = build.getProject();
Node lastBuiltOn = project.getLastBuiltOn();
Launcher lastBuiltLauncher = launcher;
if (lastBuiltOn != null) {
lastBuiltLauncher = lastBuiltOn.createLauncher(listener);
}
return lastBuiltLauncher;
}
... since the value of project.getLastBuiltOn() presumably can change during a build.
RSpec::Core::RakeTask runs specs by invoking ruby -S rspec
. When I set up a build step to run 'rake spec' with an RVM-gemsetted Ruby, it correctly runs the rake executable in the gemset bin directory, but the RSpec rake task then fails with "No such file or directory -- rspec (LoadError)".
ruby -S rspec
means "search in PATH for a script called rspec", so it looks like PATH isn't being set correctly? If I forcibly set the PATH (via the global Jenkins environment variable configuration) to include the gemset bin directory, then 'rake spec' works, but this is a Jenkins-wide setting so it defeats the point of being able to choose a Ruby per build step. I think RVM does normally set the PATH appropriately, so is it possible that rake-plugin is somehow not passing through the PATH?
The command output is as follows:
[workspace] $ /var/lib/jenkins/.rvm/gems/ruby-1.8.7-p334@dg/bin/rake spec
/var/lib/jenkins/.rvm/rubies/ruby-1.8.7-p334/bin/ruby -S rspec ./spec/deferrable_gratification/combinators/bind_spec.rb ./spec/deferrable_gratification/fluent_spec.rb ./spec/deferrable_gratification/default_deferrable_spec.rb ./spec/deferrable_gratification/bothback_spec.rb ./spec/deferrable_gratification/primitives_spec.rb ./spec/deferrable_gratification/deferrable_gratification_spec.rb ./spec/deferrable_gratification/combinators_spec.rb
(in /var/lib/jenkins/jobs/testins/workspace)
/var/lib/jenkins/.rvm/rubies/ruby-1.8.7-p334/bin/ruby: No such file or directory -- rspec (LoadError)
rake aborted!
I'm not an experienced Jenkins user, so please let me know if there's any other information I can provide to help troubleshoot this.
When used in configuration: Jenkins Master on Windows + Jenkins Slave on Linux, Rake plugin seems to not work as expected. Jenkins Console output: FATAL: \bin\rake.bat doesn't exist
Rake plugin version: 1.8.0
Referring to #4 it is currently not works correctly, because it uses the global gemset instead of the selected.
The problem described longer here: https://issues.jenkins-ci.org/browse/JENKINS-12786
I kindly ask to review this issue.
PS: Sorry for cross-posting, not clear for me where can I post issues for this plugin.
I noticed that not all my available gemsets were appearing. After inspecting the source it looks like the code that detects whether a gemset is available tries to make sure that Rake is installed. This does make sense, except it misses that Rake is available if installed via the @global gemset for each installed Ruby. My workaround was to install rake into each gemset, but could it be modified to assume that rake is available if installed in @global?
When I launch the thin server through the rake script I'm getting a seg fault. It looks like the environment isn't properly setup for rvm.
The rake script works fine if I run the task through ssh, or a shell script in jenkins running through bash.
The first problem is that all the binaries start with 'mac' instead (i.e. macrake instead of rake). With rvm the binaries get symlinks, but the plugin claims that it cannot find any ruby gems.
I made some symlinks myself and told the plugin to use the MacRuby.framework directly (like it does for the system ruby installation); then the plugin was able to find the proper rake binary, but it claimed that the proper gems were not installed.
I checked $GEM_HOME and $GEM_PATH and they are still set to my rvm default ruby and not being overridden.
Hi,
I'm getting a strange behavior when trying to build a rake step, this is the console output
Capturing environment variables produced by 'rvm use 1.9.3'
$ bash -c export
$ bash -c "test -f ~/.rvm/scripts/rvm"
[reid-functional-tests] $ bash -c " source ~/.rvm/scripts/rvm && rvm use --install --create 1.9.3 && export > rvm.env"
Using /var/lib/jenkins/.rvm/gems/ruby-1.9.3-p448
[reid-functional-tests] $ /var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/bin/rake cucumber BROWSER=headless /var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p448/bin/ruby -S bundle exec cucumber --format pretty
/Gemfile not found
Build step 'Invoke Rake' marked build as failure
Finished: FAILURE
if you notice, the not found Gemfile is related to "/", not into the working directory as expected to be found.
So, to weird issues, crazy workarounds, I put a copy of the projects Gemfile on root (/Gemfile) and it works.
OBS: I'm using RVM Plugin to set ruby environment.
Regards,
Pablo Ramírez
I have an rvm configured on the system running jenkins, which has two rubies. After adding the plugin, starting jenkins results in a NullPointerException.
The issue is due to "global" filepath being null and the plugin attempting to get specification from this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.