rtyler / vagrant-plugin

An experimental Vagrant plugin for Jenkins
https://wiki.jenkins-ci.org/display/JENKINS/Vagrant+Plugin
103 stars 45 forks source link

vagrant plugin does not trigger vagrant remotely in Jenkins #16

Open thamps opened 12 years ago

thamps commented 12 years ago

Using a Master Slave setup with Jenkins. Slave server hosts vagrant and VBox for creation of instant boxes.

Enabling vagrant plugin in jenkins, and pointing to Slave server for triggering vagrant boot. In the slave setup, jenkins checks out the vagrant file into the remote workspace only.

It is found that the vagrant plugin looks for a Vagrantfile in the local workspace rather than looking for it in the Slave workspace. So when this plugin is used for booting, it complains with

Building remotely on jenkins_slave_1 in workspace /var/lib/jenkins/workspace/demo
Cleaning local Directory .
Checking out http://192.168.3.49/svn/training/box10/vagrant-vm-ubuntu-i386
A         Vagrantfile
At revision 73
There is no Vagrantfile in your workspace!
We looked in: /var/lib/jenkins/workspace/demo
Finished: NOT_BUILT

Once I created a workspace in local workspace, it fails with

Building remotely on jenkins_slave_1 in workspace /home/aristocrat/workspace/demo
Cleaning local Directory .
Checking out http://192.168.3.49/svn/training/box10/vagrant-vm-ubuntu-i386
A         Vagrantfile
At revision 74
no change for http://192.168.3.49/svn/training/box10/vagrant-vm-ubuntu-i386 since the previous build
Running Vagrant with version: 1.0.2.dev
Vagrantfile loaded, bringing Vagrant box up for the build
FATAL: (VirtualBoxNotDetected) Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
org.jruby.exceptions.RaiseException: (VirtualBoxNotDetected) Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
this to be available on the PATH. If VirtualBox is installed, please find the
`VBoxManage` binary and add it to the PATH environmental variable.
        at Vagrant::Driver::VirtualBox.initialize(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/driver/virtualbox.rb:40)
        at Vagrant::VM.reload!(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/vm.rb:129)
        at Vagrant::VM.initialize(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/vm.rb:35)
        at Vagrant::Environment.load_vms!(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:434)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
        at Vagrant::Environment.load_vms!(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:433)
        at Vagrant::Environment.vms(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:125)
        at Vagrant::Environment.multivm?(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:158)
        at Vagrant::Environment.vms_ordered(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:133)
        at Vagrant::Command::Base.with_target_vms(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/command/base.rb:91)
        at Vagrant::Command::Up.execute(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/command/up.rb:24)
        at Vagrant::CLI.execute(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/cli.rb:38)
        at Vagrant::Environment.cli(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:167)
        at Vagrant::BasicWrapper.setup(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/models/vagrant_wrapper.rb:67)
        at Jenkins::Model::EnvironmentProxy::InstanceMethods.setUp(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/gems/jenkins-plugin-runtime-0.1.26/lib/jenkins/model/environment_proxy.rb:7)
rtyler commented 12 years ago

Starting work on this now.

(This message brought to you by Hub board)

rtyler commented 12 years ago

Looks like this is going to require a lot of work on the ruby-runtime to execute code properly on the slaves. Damnit.

rtyler commented 12 years ago

Putting this issue back on the back-burner.

(This message brought to you by Hub board)

dieterdemeyer commented 12 years ago

@rtyler do you have an idea as to if and when this issue will be handled ?

rtyler commented 12 years ago

If should be handled eventually, unfortunately this will require a lot of work in the Ruby plugin support itself to execute Ruby code on the slaves :(

jimi-c commented 11 years ago

So, last update on this was 8 months ago, has there been any progress on this? I'm still running into this issue.

axelson commented 11 years ago

Since this is a major issue I've added it to the Vagrant plugin's page on the Jenkins wiki: https://wiki.jenkins-ci.org/display/JENKINS/Vagrant+Plugin

tbartelmess commented 11 years ago

Is anyone working on this?

vishnudxb commented 11 years ago

Hi, I install vagrant plugin in Jenkins and when I try to build, I am getting the below errors. Please help me to solve this issue

Started by user anonymous Building in workspace /var/lib/jenkins/jobs/testvagrant/workspace Running Vagrant with version: 1.0.2.dev FATAL: (ArgumentError) wrong number of arguments calling initialize (1 for 0) org.jruby.exceptions.RaiseException: (ArgumentError) wrong number of arguments calling initialize (1 for 0) at RUBY.initialize(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/bundler/gems/vagrant-8a5b1ad0d1ef/lib/vagrant/environment.rb:77) at RUBY.setup(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/models/vagrant_wrapper.rb:63) at RUBY.setUp(/var/lib/jenkins/plugins/vagrant/WEB-INF/classes/vendor/gems/jruby/1.8/gems/jenkins-plugin-runtime-0.1.26/lib/jenkins/model/environment_proxy.rb:7)

davidkarlsen commented 11 years ago

Any news on this? Not very useful for only running on master...

cbarraford commented 10 years ago

would love to see this resolved, any progress?

phutchin commented 9 years ago

Is there any news on when this might be fixed?