Created
January 9, 2011 21:23
-
-
Save thbar/772034 to your computer and use it in GitHub Desktop.
Rakefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# apt update first or the build-essential will meet issues | |
include_recipe "apt" | |
include_recipe "build-essential" | |
include_recipe "rvm" | |
# upgrade the lucid32 box to 0.9.12 | |
gem_package "chef" do | |
action :install | |
version "0.9.12" | |
end | |
# require for nokogiri, which is required for sunspot-installer | |
['libxslt1-dev','libxml2-dev'].each do |pkg| | |
package pkg do | |
action :install | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rakefile allowing a two-phase work with Vagrant: | |
# - first bootstrap from the lucid32 box but applies what's missing | |
# - then regular cookbook development | |
def system!(cmd) | |
puts "Running #{cmd}" | |
raise "Error running #{cmd}!" unless system(cmd) | |
end | |
task :bootstrap do | |
system!("vagrant destroy") | |
ENV['HACKER_BOOTSTRAP'] = '1' | |
system!("vagrant up") | |
ENV['HACKER_BOOTSTRAP'] = nil | |
system!("vagrant package") | |
system("vagrant box remove hackerbooks") | |
system!("vagrant box add hackerbooks package.box") | |
system!("rm package.box") | |
system!("vagrant destroy") | |
system!("vagrant up") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant::Config.run do |config| | |
if ENV['HACKER_BOOTSTRAP'] | |
# initial bootstrapping | |
config.vm.box = "lucid32" | |
config.vm.provisioner = :chef_solo | |
config.chef.cookbooks_path = "../chef-solo/cookbooks" | |
# config.chef.log_level = :debug | |
config.chef.add_recipe "vagrant-tweaks" | |
else | |
config.vm.box = "hackerbooks" | |
config.vm.provisioner = :chef_solo | |
config.chef.cookbooks_path = File.expand_path("../chef-solo/cookbooks") | |
# config.chef.log_level = :debug | |
config.chef.add_recipe "jetty-sunspot" | |
config.vm.forward_port("solr-admin", 8983, 8984) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment