Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (88 sloc) 3.16 kb
cc66eb8 Put everything in place for gemifying, but haven't tested it
Philip (flip) Kromer authored
1 require 'rubygems' unless defined?(Gem)
2 require 'bundler'
3 begin
4 Bundler.setup(:default, :development)
5 rescue Bundler::BundlerError => e
6 $stderr.puts e.message
7 $stderr.puts "Run `bundle install` to install missing gems"
8 exit e.status_code
9 end
10
3402852 @jtimberman chef-337, bring Rakefile in line with updates upstream with metadata,…
jtimberman authored
11 require 'chef'
12 require 'json'
aa011f5 Got hadoop recipes to run to completion
Philip (flip) Kromer authored
13 TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), "."))
58dd958 @adamhjk Initial commit
adamhjk authored
14
cc66eb8 Put everything in place for gemifying, but haven't tested it
Philip (flip) Kromer authored
15 require 'jeweler'
16 Jeweler::Tasks.new do |gem|
17 # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
18 gem.name = "cluster_chef"
19 gem.homepage = "http://infochimps.com/labs"
20 gem.license = "MIT"
21 gem.summary = %Q{Chef is a powerful tool for maintaining and describing the software and configurations that let a machine provide its services.}
22 gem.description = %Q{Chef is a powerful tool for maintaining and describing the software and configurations that let a machine provide its services.}
23 gem.email = "coders@infochimps.org"
24 gem.authors = ["Infochimps"]
25
26 gem.add_development_dependency 'bundler', "~> 1.0.12"
27 gem.add_development_dependency 'jeweler', "~> 1.5.2"
28
29 ignores = File.readlines(".gitignore").grep(/^[^#]\S+/).map{|s| s.chomp }
30 dotfiles = [".gemtest", ".gitignore", ".rspec", ".yardopts"]
31 gem.files = dotfiles + Dir["**/*"].
32 reject{|f| f =~ %r{^(clusters|config|cookbooks|data_bags|roles|site-cookbooks)/} }.
33 reject{|f| File.directory?(f) }.
34 reject{|f| ignores.any?{|i| File.fnmatch(i, f) || File.fnmatch(i+'/**/*', f) } }
35 gem.test_files = gem.files.grep(/^spec\//)
36 gem.require_paths = ['lib']
37 end
38 Jeweler::RubygemsDotOrgTasks.new
39
40 require 'rspec/core'
41 require 'rspec/core/rake_task'
42 RSpec::Core::RakeTask.new(:spec) do |spec|
43 spec.pattern = FileList['spec/**/*_spec.rb']
44 end
45
46 RSpec::Core::RakeTask.new(:rcov) do |spec|
47 spec.pattern = 'spec/**/*_spec.rb'
48 spec.rcov = true
49 spec.rcov_opts = %w[ --exclude .rvm --no-comments --text-summary]
50 end
51
52 task :default => :spec
53
54 require 'yard'
55 YARD::Rake::YardocTask.new
58dd958 @adamhjk Initial commit
adamhjk authored
56
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
57 TEST_CACHE = File.expand_path(File.join(TOPDIR, ".rake_test_cache"))
58 COMPANY_NAME = "Opscode, Inc."
59 SSL_EMAIL_ADDRESS = "cookbooks@opscode.com"
60 NEW_COOKBOOK_LICENSE = :apachev2
af34e92 @jtimberman Update rakefile with comments clarifying the VCS section
jtimberman authored
61
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
62 #
63 # load all rake tasks in ./tasks/*.rake
64 #
65 Dir[ File.join(File.dirname(__FILE__), 'tasks', '*.rake') ].sort.each do |f|
66 load f
58dd958 @adamhjk Initial commit
adamhjk authored
67 end
68
3402852 @jtimberman chef-337, bring Rakefile in line with updates upstream with metadata,…
jtimberman authored
69 load 'chef/tasks/chef_repo.rake'
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
70 task :default => [ :test ]
177f4b7 @adamhjk Adding the bundle_cookbook task
adamhjk authored
71
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
72 desc "Build a bootstrap.tar.gz"
73 task :build_bootstrap do
74 bootstrap_files = Rake::FileList.new
75 %w(apache2 runit couchdb stompserver chef passenger ruby packages).each do |cookbook|
76 bootstrap_files.include "#{cookbook}/**/*"
709a15e @jtimberman updating examples and notes to reflect Chef 0.8
jtimberman authored
77 end
177f4b7 @adamhjk Adding the bundle_cookbook task
adamhjk authored
78
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
79 tmp_dir = "tmp"
80 cookbooks_dir = File.join(tmp_dir, "cookbooks")
81 rm_rf tmp_dir
82 mkdir_p cookbooks_dir
83 bootstrap_files.each do |fn|
84 f = File.join(cookbooks_dir, fn)
85 fdir = File.dirname(f)
86 mkdir_p(fdir) if !File.exist?(fdir)
87 if File.directory?(fn)
88 mkdir_p(f)
89 else
90 rm_f f
91 safe_ln(fn, f)
92 end
93 end
177f4b7 @adamhjk Adding the bundle_cookbook task
adamhjk authored
94
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
95 chdir(tmp_dir) do
96 sh %{tar zcvf bootstrap.tar.gz cookbooks}
97 end
177f4b7 @adamhjk Adding the bundle_cookbook task
adamhjk authored
98 end
99
2ec0a7b Updated rakefile from mainline
Philip (flip) Kromer authored
100 # remove unnecessary tasks
101 %w{update install roles ssl_cert}.each do |t|
102 Rake.application.instance_variable_get('@tasks').delete(t.to_s)
e710000 Retooling service discovery to go through a common interface
Philip (flip) Kromer authored
103 end
Something went wrong with that request. Please try again.