diff --git a/.gitignore b/.gitignore index fc5b76d..2793abf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ .bundle .cache .kitchen -bin +.kitchen/ +.kitchen.local.yml +.librarian/ +bin/ +tmp/ diff --git a/.kitchen.yml b/.kitchen.yml new file mode 100644 index 0000000..8132bcf --- /dev/null +++ b/.kitchen.yml @@ -0,0 +1,34 @@ +--- +driver_plugin: vagrant +driver_config: + require_chef_omnibus: true + +platforms: +- name: ubuntu-12.04 + driver_config: + box: opscode-ubuntu-12.04 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box +- name: ubuntu-10.04 + driver_config: + box: opscode-ubuntu-10.04 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box +- name: centos-6.4 + driver_config: + box: opscode-centos-6.4 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box +- name: centos-5.9 + driver_config: + box: opscode-centos-5.9 + box_url: https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box + +suites: +- name: default + run_list: ["recipe[pkg-build]", "recipe[pkg-build::ruby]", "recipe[pkg-build::passenger]"] + attributes: + pkg_build: + isolate: true + reprepro: false + passenger: + ruby_versions: + 1.9.3: + - 4.0.8 diff --git a/Cheffile b/Cheffile new file mode 100644 index 0000000..f61ff3d --- /dev/null +++ b/Cheffile @@ -0,0 +1,10 @@ +site 'http://community.opscode.com/api/v1' + +### +# +# Default Suite +# +### + +cookbook "pkg-build", + :path => "./" diff --git a/Cheffile.lock b/Cheffile.lock new file mode 100644 index 0000000..1b2a936 --- /dev/null +++ b/Cheffile.lock @@ -0,0 +1,39 @@ +SITE + remote: http://community.opscode.com/api/v1 + specs: + apache2 (1.6.6) + apt (2.0.0) + build-essential (1.4.0) + builder (0.1.1) + build-essential (>= 0.0.0) + delayed_evaluator (0.2.0) + discovery (0.2.0) + fpm-tng (0.1.7) + gpg (0.2.2) + lxc (1.0.0) + ohai (1.1.10) + repository (0.1.8) + apache2 (>= 0.0.0) + apt (>= 0.0.0) + gpg (>= 0.2.2) + reprepro (0.3.0) + apache2 (>= 0.0.0) + build-essential (>= 0.0.0) + +PATH + remote: ./ + specs: + pkg-build (0.2.0) + apt (>= 1.8.2) + builder (>= 0.0.0) + delayed_evaluator (>= 0.0.0) + discovery (>= 0.2.0) + fpm-tng (~> 0.1.4) + lxc (~> 1.0.0) + ohai (>= 0.0.0) + repository (>= 0.0.0) + reprepro (~> 0.3.0) + +DEPENDENCIES + pkg-build (>= 0) + diff --git a/Gemfile b/Gemfile index f0f457b..d6b766c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,8 @@ source :rubygems -gem 'test-kitchen' +gem "test-kitchen", ">= 1.0.0.alpha.7" +gem "librarian-chef", ">= 0.0.1" + +group :vagrant do + gem "kitchen-vagrant" +end diff --git a/Gemfile.lock b/Gemfile.lock index efcff47..523ad94 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,130 +2,85 @@ GEM remote: http://rubygems.org/ specs: archive-tar-minitar (0.5.2) - builder (3.1.4) - bunny (0.7.9) - chef (10.16.6) - bunny (>= 0.6.0, < 0.8.0) + celluloid (0.14.1) + timers (>= 1.0.0) + chef (11.4.4) erubis highline (>= 1.6.9) - json (>= 1.4.4, <= 1.6.1) + json (>= 1.4.4, <= 1.7.7) mixlib-authentication (>= 1.3.0) - mixlib-cli (>= 1.1.0) + mixlib-cli (~> 1.3.0) mixlib-config (>= 1.1.2) mixlib-log (>= 1.3.0) mixlib-shellout - moneta (< 0.7.0) - net-ssh (~> 2.2.2) + net-ssh (~> 2.6) net-ssh-multi (~> 1.1.0) ohai (>= 0.6.0) rest-client (>= 1.0.4, < 1.7.0) - treetop (~> 1.4.9) - uuidtools yajl-ruby (~> 1.1) - childprocess (0.3.6) - ffi (~> 1.0, >= 1.0.6) - coderay (1.0.8) + coderay (1.0.9) erubis (2.7.0) - excon (0.16.10) - ffi (1.3.1) - fog (1.8.0) - builder - excon (~> 0.14) - formatador (~> 0.2.0) - mime-types - multi_json (~> 1.0) - net-scp (~> 1.0.4) - net-ssh (>= 2.1.3) - nokogiri (~> 1.5.0) - ruby-hmac - foodcritic (1.7.0) - erubis - gherkin (~> 2.11.1) - gist (~> 3.1.0) - nokogiri (~> 1.5.4) - pry (~> 0.9.8.4) - rak (~> 1.4) - treetop (~> 1.4.10) - yajl-ruby (~> 1.1.0) - formatador (0.2.4) - gherkin (2.11.5) - json (>= 1.4.6) - gist (3.1.1) - hashr (0.0.22) - highline (1.6.15) - i18n (0.6.1) + highline (1.6.19) ipaddress (0.8.0) - json (1.5.4) - librarian (0.0.26) - archive-tar-minitar (>= 0.5.2) - chef (>= 0.10) + json (1.7.7) + kitchen-vagrant (0.10.0) + test-kitchen (~> 1.0.0.alpha.6) + librarian (0.1.0) highline thor (~> 0.15) - log4r (1.1.10) - method_source (0.7.1) - mime-types (1.19) + librarian-chef (0.0.1) + archive-tar-minitar (>= 0.5.2) + chef (>= 0.10) + librarian (~> 0.1.0) + method_source (0.8.1) + mime-types (1.23) mixlib-authentication (1.3.0) mixlib-log - mixlib-cli (1.2.2) + mixlib-cli (1.3.0) mixlib-config (1.1.2) - mixlib-log (1.4.1) + mixlib-log (1.6.0) mixlib-shellout (1.1.0) - moneta (0.6.0) - multi_json (1.5.0) - net-scp (1.0.4) - net-ssh (>= 1.99.1) - net-ssh (2.2.2) - net-ssh-gateway (1.1.0) - net-ssh (>= 1.99.1) + net-scp (1.1.2) + net-ssh (>= 2.6.5) + net-ssh (2.6.8) + net-ssh-gateway (1.2.0) + net-ssh (>= 2.6.5) net-ssh-multi (1.1) net-ssh (>= 2.1.4) net-ssh-gateway (>= 0.99.0) - nokogiri (1.5.6) - ohai (6.14.0) + ohai (6.16.0) ipaddress mixlib-cli mixlib-config mixlib-log + mixlib-shellout systemu yajl-ruby - polyglot (0.3.3) - pry (0.9.8.4) + pry (0.9.12.2) coderay (~> 1.0.5) - method_source (~> 0.7.1) - slop (>= 2.4.4, < 3) - rak (1.4) + method_source (~> 0.8) + slop (~> 3.4) rest-client (1.6.7) mime-types (>= 1.16) - ruby-hmac (0.4.0) - slop (2.4.4) + safe_yaml (0.9.4) + slop (3.4.5) systemu (2.5.2) - test-kitchen (0.7.0) - fog - foodcritic (>= 1.4.0) - hashr (~> 0.0.20) - highline (>= 1.6.9) - librarian (~> 0.0.20) - mixlib-cli (~> 1.2.2) - vagrant (~> 1.0.2) - yajl-ruby (~> 1.1.0) - thor (0.16.0) - treetop (1.4.12) - polyglot - polyglot (>= 0.3.1) - uuidtools (2.1.3) - vagrant (1.0.5) - archive-tar-minitar (= 0.5.2) - childprocess (~> 0.3.1) - erubis (~> 2.7.0) - i18n (~> 0.6.0) - json (~> 1.5.1) - log4r (~> 1.1.9) - net-scp (~> 1.0.4) - net-ssh (~> 2.2.2) + test-kitchen (1.0.0.dev) + celluloid + mixlib-shellout + net-scp + net-ssh + pry + safe_yaml + thor + thor (0.18.1) + timers (1.1.0) yajl-ruby (1.1.0) PLATFORMS ruby DEPENDENCIES - test-kitchen + kitchen-vagrant + librarian-chef (>= 0.0.1) + test-kitchen (>= 1.0.0.alpha.7) diff --git a/recipes/default.rb b/recipes/default.rb index 9ac8e6d..c84f8c6 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -9,9 +9,9 @@ service_name 'apt-cacher-ng' action :restart end - + Chef::Log.info 'Building containers for isolated package construction' - + directory node[:pkg_build][:isolate_solo_dir] do recursive true end @@ -87,17 +87,19 @@ mode 0644 end end - - # Force full cookbook downloads - CookbookSynchronizer.send(:remove_const, :EAGER_SEGMENTS) - CookbookSynchronizer.const_set(:EAGER_SEGMENTS, CookbookVersion::COOKBOOK_SEGMENTS) - Chef::Log.warn 'Performing full cookbook sync...' - rest = Chef::REST.new(Chef::Config[:chef_server_url], node.name, Chef::Config[:client_key]) - run_list_expansion = node.run_list.expand(node.chef_environment) - cookbook_hash = rest.post_rest( - "environments/#{node.chef_environment}/cookbook_versions", - :run_list => run_list_expansion.recipes.with_version_constraints_strings - ) - CookbookSynchronizer.new(cookbook_hash, EventDispatch::Dispatcher.new).sync_cookbooks - Chef::Log.warn 'Full cookbook sync has been completed!' + + unless Chef::Config[:solo] + # Force full cookbook downloads + CookbookSynchronizer.send(:remove_const, :EAGER_SEGMENTS) + CookbookSynchronizer.const_set(:EAGER_SEGMENTS, CookbookVersion::COOKBOOK_SEGMENTS) + Chef::Log.warn 'Performing full cookbook sync...' + rest = Chef::REST.new(Chef::Config[:chef_server_url], node.name, Chef::Config[:client_key]) + run_list_expansion = node.run_list.expand(node.chef_environment) + cookbook_hash = rest.post_rest( + "environments/#{node.chef_environment}/cookbook_versions", + :run_list => run_list_expansion.recipes.with_version_constraints_strings + ) + CookbookSynchronizer.new(cookbook_hash, EventDispatch::Dispatcher.new).sync_cookbooks + Chef::Log.warn 'Full cookbook sync has been completed!' + end end