Best way to develop vagrant plugins?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to develop vagrant plugins?

Adam Feuer
Hi,

What's the best way to develop a vagrant plugin? I have been following the documentation, and can install some plugins that are listed here:


But I am having trouble figuring out how to develop my own plugin - it's not ready to be uploaded to the RubyGems repository. Ideally there would be a way to install the plugin directly from my source directory (or linked to it) so I wouldn't have to reinstall the plugin to run it. Is that possible? If so, how?

I tried installing the plugin using --plugin-source=file:///path/to/my/local/gem-repository - and it seems like the plugin starts to load, but then fails to load a dependency.

If it helps, here's the end of a debug log that shows the error... vagrant seems to find the repo, but can't resolve the 'git' dependency. I the git-1.2.5 gem is in the local repo (and of course on RubyGems), and I have run gem generate_index to create the index for the local repo...

Does anyone have any idea what's wrong?

 INFO cli: CLI: [] "plugin" ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG cli: Invoking command class: VagrantPlugins::CommandPlugin::Command::Root ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG root: Invoking command class: VagrantPlugins::CommandPlugin::Command::Install ["--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000103ab5dc0>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::BundlerCheck:0x0000010214d388>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO interface: info: Installing the 'vagrant-stack' plugin. This can take a few minutes...
Installing the 'vagrant-stack' plugin. This can take a few minutes...
DEBUG gemhelper: Set GEM_* to: /Users/adam/.vagrant.d/gems
 INFO installgem: Custom plugin sources: ["file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository"]
ERROR warden: Error occurred: Unable to resolve dependencies: vagrant-stack requires git (>= 0)
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000100882fd8>
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:153:in `gather_dependencies': Unable to resolve dependencies: vagrant-stack requires git (>= 0) (Gem::DependencyError)
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:38:in `block in call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:28:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builder.rb:109:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/base.rb:17:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/install.rb:44:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/root.rb:47:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/cli.rb:46:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:406:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:60:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

cheers
adam

--
Adam Feuer <[hidden email]>

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Best way to develop vagrant plugins?

Adam Feuer
Update:

Ok, by re-reading the instructions here:


I got the plugin installed by doing:

vagrant plugin install /path/to/plugin.gem

I think I now understand how to test the plugin using a Vagrant source installation too - I am going to try that next so I don't have to run the package and install over and over.

-adam


On Wed, Mar 27, 2013 at 4:45 PM, Adam Feuer <[hidden email]> wrote:
Hi,

What's the best way to develop a vagrant plugin? I have been following the documentation, and can install some plugins that are listed here:


But I am having trouble figuring out how to develop my own plugin - it's not ready to be uploaded to the RubyGems repository. Ideally there would be a way to install the plugin directly from my source directory (or linked to it) so I wouldn't have to reinstall the plugin to run it. Is that possible? If so, how?

I tried installing the plugin using --plugin-source=file:///path/to/my/local/gem-repository - and it seems like the plugin starts to load, but then fails to load a dependency.

If it helps, here's the end of a debug log that shows the error... vagrant seems to find the repo, but can't resolve the 'git' dependency. I the git-1.2.5 gem is in the local repo (and of course on RubyGems), and I have run gem generate_index to create the index for the local repo...

Does anyone have any idea what's wrong?

 INFO cli: CLI: [] "plugin" ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG cli: Invoking command class: VagrantPlugins::CommandPlugin::Command::Root ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG root: Invoking command class: VagrantPlugins::CommandPlugin::Command::Install ["--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000103ab5dc0>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::BundlerCheck:0x0000010214d388>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO interface: info: Installing the 'vagrant-stack' plugin. This can take a few minutes...
Installing the 'vagrant-stack' plugin. This can take a few minutes...
DEBUG gemhelper: Set GEM_* to: /Users/adam/.vagrant.d/gems
 INFO installgem: Custom plugin sources: ["file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository"]
ERROR warden: Error occurred: Unable to resolve dependencies: vagrant-stack requires git (>= 0)
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000100882fd8>
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:153:in `gather_dependencies': Unable to resolve dependencies: vagrant-stack requires git (>= 0) (Gem::DependencyError)
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:38:in `block in call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:28:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builder.rb:109:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/base.rb:17:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/install.rb:44:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/root.rb:47:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/cli.rb:46:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:406:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:60:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

cheers
adam

--
Adam Feuer <[hidden email]>



--
Adam Feuer <[hidden email]>

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Best way to develop vagrant plugins?

Adam Feuer
Update:

Ok, I can execute the plugin from its source directory using bundle exec, with a Vagrantfile that requires the plugin.

-adam


On Wed, Mar 27, 2013 at 4:57 PM, Adam Feuer <[hidden email]> wrote:
Update:

Ok, by re-reading the instructions here:


I got the plugin installed by doing:

vagrant plugin install /path/to/plugin.gem

I think I now understand how to test the plugin using a Vagrant source installation too - I am going to try that next so I don't have to run the package and install over and over.

-adam


On Wed, Mar 27, 2013 at 4:45 PM, Adam Feuer <[hidden email]> wrote:
Hi,

What's the best way to develop a vagrant plugin? I have been following the documentation, and can install some plugins that are listed here:


But I am having trouble figuring out how to develop my own plugin - it's not ready to be uploaded to the RubyGems repository. Ideally there would be a way to install the plugin directly from my source directory (or linked to it) so I wouldn't have to reinstall the plugin to run it. Is that possible? If so, how?

I tried installing the plugin using --plugin-source=file:///path/to/my/local/gem-repository - and it seems like the plugin starts to load, but then fails to load a dependency.

If it helps, here's the end of a debug log that shows the error... vagrant seems to find the repo, but can't resolve the 'git' dependency. I the git-1.2.5 gem is in the local repo (and of course on RubyGems), and I have run gem generate_index to create the index for the local repo...

Does anyone have any idea what's wrong?

 INFO cli: CLI: [] "plugin" ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG cli: Invoking command class: VagrantPlugins::CommandPlugin::Command::Root ["install", "--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
DEBUG root: Invoking command class: VagrantPlugins::CommandPlugin::Command::Install ["--plugin-source", "file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository", "vagrant-stack"]
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000103ab5dc0>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::BundlerCheck:0x0000010214d388>
 INFO warden: Calling action: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO interface: info: Installing the 'vagrant-stack' plugin. This can take a few minutes...
Installing the 'vagrant-stack' plugin. This can take a few minutes...
DEBUG gemhelper: Set GEM_* to: /Users/adam/.vagrant.d/gems
 INFO installgem: Custom plugin sources: ["file:///Users/adam/personal/proj/personalcloud/experiments/gem-repository"]
ERROR warden: Error occurred: Unable to resolve dependencies: vagrant-stack requires git (>= 0)
 INFO warden: Beginning recovery process...
 INFO warden: Calling recover: #<VagrantPlugins::CommandPlugin::Action::InstallGem:0x0000010214d338>
 INFO warden: Recovery complete.
 INFO warden: Beginning recovery process...
 INFO warden: Recovery complete.
 INFO environment: Running hook: environment_unload
 INFO runner: Running action: #<Vagrant::Action::Builder:0x00000100882fd8>
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:153:in `gather_dependencies': Unable to resolve dependencies: vagrant-stack requires git (>= 0) (Gem::DependencyError)
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:38:in `block in call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:42:in `block in with_environment'
from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/user_interaction.rb:40:in `use_ui'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/gem_helper.rb:41:in `with_environment'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/install_gem.rb:28:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builder.rb:109:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/base.rb:17:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/install.rb:44:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/plugin/command/root.rb:47:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/cli.rb:46:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:406:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:60:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

cheers
adam

--
Adam Feuer <[hidden email]>



--
Adam Feuer <[hidden email]>



--
Adam Feuer <[hidden email]>

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.