wolfeidau / rake-bamboo-plugin

Plugin for bamboo which enables building of ruby projects using rake
Other
34 stars 16 forks source link

Don't assume bundle is installed next to ruby #66

Closed MartinMeinhold closed 10 years ago

MartinMeinhold commented 10 years ago

On our Bamboo agent, the bundler gem is installed in /usr/local/bin/bundle instead of the expected /usr/bin/bundle, hence causing the following exception:

2014-04-08 00:58:44,775 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [RubyLocatorServiceFactory] Loaded ruby runtime managers [au.id.wolfe.bamboo.ruby.rbenv.RbenvRubyRuntimeLocatorService@3db8d241, au.id.wolfe.bamboo.ruby.rvm.RvmRubyRuntimeLocatorService@30f3c90f, au.id.wolfe.bamboo.ruby.windows.WindowsRubyRuntimeLocatorService@551510e4] 
2014-04-08 00:58:44,794 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [ExecUtils] ruby exit code  = 0
2014-04-08 00:58:44,794 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [ExecUtils] ruby version = ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
2014-04-08 00:58:44,841 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [ExecUtils] gem exit code  = 0
2014-04-08 00:58:44,842 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [ExecUtils] gem path = /var/lib/gems/1.8:/opt/bamboo-agent/.gem/ruby/1.8
2014-04-08 00:58:44,843 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [BaseRubyLocator] rubyExecutablePath /usr/bin/ruby
2014-04-08 00:58:44,848 INFO [3-BAM::some.agent.com::Agent:pool-6-thread-1] [BaseRubyLocator] Checking executable /usr/bin/bundle
2014-04-08 00:58:44,848 ERROR [3-BAM::some.agent.com::Agent:pool-6-thread-1] [BaseRubyLocator] Executable /usr/bin/bundle not found.
2014-04-08 00:58:44,848 ERROR [3-BAM::some.agent.com::Agent:pool-6-thread-1] [AbstractRubyTask] Executable /usr/bin/bundle not found in ruby bin path.
java.lang.IllegalArgumentException: Executable /usr/bin/bundle not found in ruby bin path.
        at au.id.wolfe.bamboo.ruby.locator.BaseRubyLocator.buildExecutablePath(BaseRubyLocator.java:29)
        at au.id.wolfe.bamboo.ruby.tasks.bundler.install.BundlerInstallCommandBuilder.addBundleExecutable(BundlerInstallCommandBuilder.java:32)
        at au.id.wolfe.bamboo.ruby.tasks.bundler.install.BundlerInstallTask.buildCommandList(BundlerInstallTask.java:32)
        at au.id.wolfe.bamboo.ruby.tasks.AbstractRubyTask.execute(AbstractRubyTask.java:71)
        at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:220)
        at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:98)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:75)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:181)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:101)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:108)
        at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
        at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
        at java.lang.Thread.run(Thread.java:662)

It would be nice if the task either would allow to specify the bundle executable via the ui or would try to find it on the $PATH.

wolfeidau commented 10 years ago

I am trying to keep it simple within the software, I originally adopted these patterns to avoid half installed or duplicate installs screwing up system installed stuff. If you want fine grained management of versions then use RVM or rbenv.