Permalink
Browse files

add support for librarian-chef

  • Loading branch information...
1 parent 909ead9 commit dbd6a498c8dca5b98d72bc46c04dee6266f68fce Zachary Patten committed Jun 22, 2012
View
4 bin/cucumber-chef
@@ -110,6 +110,10 @@ class CucumberChef < Thor
puts
@region = ask "Which region are you using?", :bold
puts
+ say("One last thing. If your using librarian-chef, we want to be sure all the hooks are in place.")
+ puts
+ @librarian_chef = yes?("Does this chef-repo use librarian-chef?", :bold)
+ puts
say "Awesome. Thank you!"
puts
end
View
20 lib/cucumber/chef/config.rb
@@ -153,17 +153,19 @@ def self.aws_image_id
################################################################################
- mode :user
- provider :aws
- prerelease true
+ mode :user
+ prerelease true
- aws Hash[ :ubuntu_release => "precise",
- :aws_instance_arch => "i386",
- :aws_instance_disk_store => "ebs",
- :aws_instance_type => "m1.small",
- :aws_security_group => "cucumber-chef" ]
+ provider :aws
+ librarian_chef false
- vagrant Hash.new
+ aws Hash[ :ubuntu_release => "precise",
+ :aws_instance_arch => "i386",
+ :aws_instance_disk_store => "ebs",
+ :aws_instance_type => "m1.small",
+ :aws_security_group => "cucumber-chef" ]
+
+ vagrant Hash.new
################################################################################
View
2 lib/cucumber/chef/provisioner.rb
@@ -149,7 +149,7 @@ def render_knife_rb
template_file = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "lib", "cucumber", "chef", "templates", "cucumber-chef", "knife-rb.erb"))
knife_rb = File.expand_path(File.join(Cucumber::Chef.locate(:directory, ".cucumber-chef"), "knife.rb"))
- context = { :chef_server => @server.public_ip_address }
+ context = { :chef_server => @server.public_ip_address, :librarian_chef => Cucumber::Chef::Config[:librarian_chef] }
File.open(knife_rb, 'w') do |f|
f.puts(Cucumber::Chef::Template.render(template_file, context))
end
View
5 lib/cucumber/chef/templates/cucumber-chef/config-rb.erb
@@ -2,8 +2,8 @@
# Cucumber-Chef
################################################################################
-mode :user
provider :aws
+librarian_chef <%= @librarian_chef %>
################################################################################
@@ -19,9 +19,6 @@ aws[:identity_file] = "<%= File.join(@aws_ssh_key_dir, @aws_ssh_key)
aws[:region] = "<%= @region %>-1"
aws[:availability_zone] = "<%= @region %>-1a"
-#aws[:aws_image_id] = "ami-339ca947"
-#aws[:ubuntu_release] = "maverick"
-
#aws[:aws_instance_arch] = "i386"
#aws[:aws_instance_disk_store] = "instance-store"
#aws[:aws_instance_type] = "m1.small"
View
5 lib/cucumber/chef/templates/cucumber-chef/knife-rb.erb
@@ -12,3 +12,8 @@ cache_type "BasicFile"
cookbook_path ['#{current_dir}/../cookbooks']
cache_options(:path => "#{current_dir}/checksums")
+<% if @config[:librarian_chef] -%>
+
+require 'librarian/chef/integration/knife'
+cookbook_path Librarian::Chef.install_path, "#{current_dir}/../site-cookbooks"
+<% end -%>

0 comments on commit dbd6a49

Please sign in to comment.