Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.bundle
.cache
.kitchen
bin
.kitchen/
.kitchen.local.yml
.librarian/
bin/
tmp/
34 changes: 34 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
site 'http://community.opscode.com/api/v1'

###
#
# Default Suite
#
###

cookbook "pkg-build",
:path => "./"
39 changes: 39 additions & 0 deletions Cheffile.lock
Original file line number Diff line number Diff line change
@@ -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)

7 changes: 6 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -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
135 changes: 45 additions & 90 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
32 changes: 17 additions & 15 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just use the chef_zero TK provisioner, instead of adding this condition.

# 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