Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying to get the vagrant plugin to work

  • Loading branch information...
commit d96eac916b469699d96cdad79c0365c8b02e3a2c 1 parent de389ff
@jedi4ever authored
View
7 Gemfile
@@ -2,9 +2,4 @@ source "http://rubygems.org"
gem "veewee", :path => "."
-gem 'net-ssh'
-gem 'virtualbox'
-gem 'popen4'
-gem 'vagrant'
-gem 'thor'
-gem 'highline'
+gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
View
34 Gemfile.lock
@@ -1,3 +1,18 @@
+GIT
+ remote: git://github.com/mitchellh/vagrant.git
+ revision: dc0b17583899a5cf0096f7e50fc80eb286977946
+ specs:
+ vagrant (0.7.2.dev)
+ archive-tar-minitar (= 0.5.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ json (~> 1.5.1)
+ mario (~> 0.0.6)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.1.0)
+ thor (~> 0.14.6)
+ virtualbox (~> 0.8.3)
+
PATH
remote: .
specs:
@@ -20,7 +35,7 @@ GEM
rake (>= 0.8.7)
highline (1.6.1)
i18n (0.5.0)
- json (1.4.6)
+ json (1.5.1)
mario (0.0.6)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
@@ -31,16 +46,6 @@ GEM
open4 (>= 0.4.0)
rake (0.8.7)
thor (0.14.6)
- vagrant (0.7.1)
- archive-tar-minitar (= 0.5.2)
- erubis (~> 2.6.6)
- i18n (~> 0.5.0)
- json (~> 1.4.6)
- mario (~> 0.0.6)
- net-scp (~> 1.0.4)
- net-ssh (~> 2.1.0)
- thor (~> 0.14.6)
- virtualbox (~> 0.8.3)
virtualbox (0.8.3)
ffi (~> 0.6.3)
@@ -48,10 +53,5 @@ PLATFORMS
ruby
DEPENDENCIES
- highline
- net-ssh
- popen4
- thor
- vagrant
+ vagrant!
veewee!
- virtualbox
View
1  lib/vagrant_init.rb
@@ -1 +1,2 @@
require 'veewee'
+puts "here we are"
View
14 lib/veewee.rb
@@ -1,3 +1,15 @@
require 'vagrant'
-require 'veewee/config'
+#require 'veewee/config'
require 'veewee/command'
+#require 'veewee/middleware'
+
+
+#basebox = Vagrant::Action::Builder.new do
+ #use BaseBoxMiddleware
+#end
+
+#Vagrant::Action.register :basebox, basebox
+
+# Add our custom translations to the load path
+I18n.load_path << File.expand_path("../../locales/en.yml", __FILE__)
+
View
85 lib/veewee/command.rb
@@ -1,66 +1,23 @@
-require 'veewee/session'
-
-#Load Veewee::Session libraries
-lib_dir= File.expand_path(File.join(File.dirname(__FILE__),"..","..", "lib"))
-Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f| require f }
-
-#Setup some base variables to use
-template_dir=File.expand_path(File.join(lib_dir,"..", "templates"))
-
-veewee_dir="."
-definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
-tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
-iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
-box_dir=File.expand_path(File.join(veewee_dir, "boxes"))
-
-#Initialize
-Veewee::Session.setenv({:veewee_dir => veewee_dir, :definition_dir => definition_dir,
- :template_dir => template_dir, :iso_dir => iso_dir, :box_dir => box_dir, :tmp_dir => tmp_dir})
-
-puts "we get here"
-
-class BaseBoxCommand < Vagrant::Command::GroupBase
- register "basebox","Commands to manage baseboxes"
-
- desc "templates", "List the currently available box templates"
- def templates
- Veewee::Session.list_templates
- end
-
- desc "define BOXNAME TEMPLATE", "Define a new box starting from a template"
- def define(boxname, template)
- puts "define a new box #{boxname}, starting from template #{template}"
- Veewee::Session.define(boxname,template)
- end
-
- desc "build BOXNAME", "Build the box BOXNAME"
- def build(boxname)
- puts "Building box #{boxname}"
- Veewee::Session.build(boxname)
- end
-
- desc "ostypes", "List the available Operating System types"
- def ostypes
- puts "Operating System types:"
- Veewee::Session.list_ostypes
- end
-
- desc "clean", "Clean all unfinished builds"
- def clean
- puts "Cleaning all unfinished builds"
- end
-
-end
-
-
-class SayHelloCommand < Vagrant::Command::Base
- register "hello", "Says hello then goodbye"
-
- def hello
- puts "HELLO!"
- end
-
- def goodbye
- puts "GOODBYE!"
+module Veewee
+ class Command < Vagrant::Command::Base
+ register "bla", "Run a rake task inside the VM environment"
+ #argument :rake_command, :type => :array, :required => false, :desc => "The command to run on the VM via Rake"
+ #class_option :cwd, :type => :string, :default => nil
+
+ # Executes the given rake command on the VMs that are represented
+ # by this environment.
+ def execute
+ command = (rake_command || []).join(" ")
+ target_vms.each { |vm| execute_on_vm(vm, command) }
+ end
+
+ protected
+
+ # Executes a command on a specific VM.
+ def execute_on_vm(vm, command)
+ vm.env.actions.run(:rake,
+ "rake.command" => command,
+ "rake.cwd" => options[:cwd])
+ end
end
end
View
2  lib/veewee/config.rb
@@ -1,5 +1,5 @@
module Veewee
- class Config < Vagrant::Config::Base
+ class BaseBoxConfig < Vagrant::Config::Base
configures :basebox
end
end
View
2  veewee.gemspec
@@ -20,6 +20,8 @@ Gem::Specification.new do |s|
s.add_dependency "thor", "~> 0.14.6"
s.add_dependency "highline", "~> 1.6.1"
+ s.add_development_dependency "bundler", ">= 1.0.0"
+
s.files = `git ls-files`.split("\n")
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
s.require_path = 'lib'
Please sign in to comment.
Something went wrong with that request. Please try again.