pantry-chef 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.travis.yml +16 -0
- data/Gemfile +15 -0
- data/LICENSE +20 -0
- data/README.md +49 -0
- data/Rakefile +18 -0
- data/lib/pantry/chef.rb +47 -0
- data/lib/pantry/chef/configure_chef.rb +59 -0
- data/lib/pantry/chef/list_cookbooks.rb +31 -0
- data/lib/pantry/chef/run.rb +30 -0
- data/lib/pantry/chef/run_chef_solo.rb +21 -0
- data/lib/pantry/chef/send_cookbooks.rb +23 -0
- data/lib/pantry/chef/sync_cookbooks.rb +84 -0
- data/lib/pantry/chef/sync_data_bags.rb +19 -0
- data/lib/pantry/chef/sync_environments.rb +19 -0
- data/lib/pantry/chef/sync_roles.rb +19 -0
- data/lib/pantry/chef/upload_cookbook.rb +110 -0
- data/lib/pantry/chef/upload_data_bag.rb +37 -0
- data/lib/pantry/chef/upload_environment.rb +28 -0
- data/lib/pantry/chef/upload_role.rb +28 -0
- data/lib/pantry/chef/version.rb +5 -0
- data/lib/pantry/init.rb +1 -0
- data/pantry-chef.gemspec +27 -0
- data/test/acceptance/chef/run_test.rb +69 -0
- data/test/acceptance/chef/upload_cookbook_test.rb +26 -0
- data/test/acceptance/chef/upload_data_bag_test.rb +36 -0
- data/test/acceptance/chef/upload_environment_test.rb +22 -0
- data/test/acceptance/chef/upload_role_test.rb +21 -0
- data/test/acceptance/test_helper.rb +25 -0
- data/test/fixtures/cookbooks/bad/recipes/default.rb +1 -0
- data/test/fixtures/cookbooks/mini/metadata.rb +5 -0
- data/test/fixtures/cookbooks/mini/recipes/default.rb +1 -0
- data/test/fixtures/data_bags/settings/test.json +0 -0
- data/test/fixtures/environments/test.rb +2 -0
- data/test/fixtures/roles/app.rb +2 -0
- data/test/fixtures/roles/app1.rb +2 -0
- data/test/root_dir/applications/pantry/chef/roles/app.rb +2 -0
- data/test/unit/chef/configure_chef_test.rb +64 -0
- data/test/unit/chef/list_cookbooks_test.rb +49 -0
- data/test/unit/chef/run_chef_solo_test.rb +29 -0
- data/test/unit/chef/run_test.rb +5 -0
- data/test/unit/chef/send_cookbooks_test.rb +44 -0
- data/test/unit/chef/sync_cookbooks_test.rb +40 -0
- data/test/unit/chef/sync_data_bags_test.rb +21 -0
- data/test/unit/chef/sync_environments_test.rb +21 -0
- data/test/unit/chef/sync_roles_test.rb +21 -0
- data/test/unit/chef/upload_cookbook_test.rb +132 -0
- data/test/unit/chef/upload_data_bag_test.rb +24 -0
- data/test/unit/chef/upload_environment_test.rb +11 -0
- data/test/unit/chef/upload_role_test.rb +11 -0
- data/test/unit/test_helper.rb +26 -0
- metadata +166 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'unit/test_helper'
|
2
|
+
|
3
|
+
describe Pantry::Chef::UploadDataBag do
|
4
|
+
|
5
|
+
fake_fs!
|
6
|
+
|
7
|
+
it "uploads the resulting file to the application's chef environments directory" do
|
8
|
+
command = Pantry::Chef::UploadDataBag.new
|
9
|
+
assert_equal Pantry.root.join("applications", "pantry", "chef", "data_bags", "settings"),
|
10
|
+
command.upload_directory({application: "pantry", type: "settings"})
|
11
|
+
end
|
12
|
+
|
13
|
+
it "defaults the data bag type to the file's directory" do
|
14
|
+
FileUtils.mkdir_p("data_bags/settings")
|
15
|
+
FileUtils.touch("data_bags/settings/test.json")
|
16
|
+
|
17
|
+
command = Pantry::Chef::UploadDataBag.new("data_bags/settings/test.json")
|
18
|
+
|
19
|
+
message = command.prepare_message({application: "pantry"})
|
20
|
+
|
21
|
+
assert_equal({application: "pantry", type: "settings"}, message.body[0])
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'unit/test_helper'
|
2
|
+
|
3
|
+
describe Pantry::Chef::UploadEnvironment do
|
4
|
+
|
5
|
+
it "uploads the resulting file to the application's chef environments directory" do
|
6
|
+
command = Pantry::Chef::UploadEnvironment.new
|
7
|
+
assert_equal Pantry.root.join("applications", "pantry", "chef", "environments"),
|
8
|
+
command.upload_directory(application: "pantry")
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'unit/test_helper'
|
2
|
+
|
3
|
+
describe Pantry::Chef::UploadRole do
|
4
|
+
|
5
|
+
it "uploads the resulting file to the application's chef environments directory" do
|
6
|
+
command = Pantry::Chef::UploadRole.new
|
7
|
+
assert_equal Pantry.root.join("applications", "pantry", "chef", "roles"),
|
8
|
+
command.upload_directory(application: "pantry")
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'pantry/test/unit'
|
2
|
+
require 'pantry/chef'
|
3
|
+
require 'mocha/mini_test'
|
4
|
+
|
5
|
+
Pantry.logger.disable!
|
6
|
+
#Pantry.config.log_level = :debug
|
7
|
+
|
8
|
+
class Minitest::Test
|
9
|
+
|
10
|
+
def setup
|
11
|
+
Pantry.config.root_dir = File.expand_path("../../root_dir", __FILE__)
|
12
|
+
clean_up_pantry_root
|
13
|
+
end
|
14
|
+
|
15
|
+
# Ensure Pantry.root is always clean for each test.
|
16
|
+
def clean_up_pantry_root
|
17
|
+
Dir["#{Pantry.root}/**/*"].each do |file|
|
18
|
+
FileUtils.rm_rf file
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def fixture_path(file_path)
|
23
|
+
File.join(File.dirname(__FILE__), "..", "fixtures", file_path)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pantry-chef
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Collective Idea
|
8
|
+
- Jason Roelofs
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-03-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: pantry
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.1'
|
21
|
+
- - '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.1.0
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0.1'
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.0
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: chef
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '11.10'
|
41
|
+
- - '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 11.10.0
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ~>
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '11.10'
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 11.10.0
|
54
|
+
description: |2
|
55
|
+
Add Chef support to a Pantry network.
|
56
|
+
email:
|
57
|
+
- code@collectiveidea.com
|
58
|
+
- jasongroelofs@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- .gitignore
|
64
|
+
- .travis.yml
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- lib/pantry/chef.rb
|
70
|
+
- lib/pantry/chef/configure_chef.rb
|
71
|
+
- lib/pantry/chef/list_cookbooks.rb
|
72
|
+
- lib/pantry/chef/run.rb
|
73
|
+
- lib/pantry/chef/run_chef_solo.rb
|
74
|
+
- lib/pantry/chef/send_cookbooks.rb
|
75
|
+
- lib/pantry/chef/sync_cookbooks.rb
|
76
|
+
- lib/pantry/chef/sync_data_bags.rb
|
77
|
+
- lib/pantry/chef/sync_environments.rb
|
78
|
+
- lib/pantry/chef/sync_roles.rb
|
79
|
+
- lib/pantry/chef/upload_cookbook.rb
|
80
|
+
- lib/pantry/chef/upload_data_bag.rb
|
81
|
+
- lib/pantry/chef/upload_environment.rb
|
82
|
+
- lib/pantry/chef/upload_role.rb
|
83
|
+
- lib/pantry/chef/version.rb
|
84
|
+
- lib/pantry/init.rb
|
85
|
+
- pantry-chef.gemspec
|
86
|
+
- test/acceptance/chef/run_test.rb
|
87
|
+
- test/acceptance/chef/upload_cookbook_test.rb
|
88
|
+
- test/acceptance/chef/upload_data_bag_test.rb
|
89
|
+
- test/acceptance/chef/upload_environment_test.rb
|
90
|
+
- test/acceptance/chef/upload_role_test.rb
|
91
|
+
- test/acceptance/test_helper.rb
|
92
|
+
- test/fixtures/cookbooks/bad/recipes/default.rb
|
93
|
+
- test/fixtures/cookbooks/mini/metadata.rb
|
94
|
+
- test/fixtures/cookbooks/mini/recipes/default.rb
|
95
|
+
- test/fixtures/data_bags/settings/test.json
|
96
|
+
- test/fixtures/environments/test.rb
|
97
|
+
- test/fixtures/roles/app.rb
|
98
|
+
- test/fixtures/roles/app1.rb
|
99
|
+
- test/root_dir/applications/pantry/chef/roles/app.rb
|
100
|
+
- test/unit/chef/configure_chef_test.rb
|
101
|
+
- test/unit/chef/list_cookbooks_test.rb
|
102
|
+
- test/unit/chef/run_chef_solo_test.rb
|
103
|
+
- test/unit/chef/run_test.rb
|
104
|
+
- test/unit/chef/send_cookbooks_test.rb
|
105
|
+
- test/unit/chef/sync_cookbooks_test.rb
|
106
|
+
- test/unit/chef/sync_data_bags_test.rb
|
107
|
+
- test/unit/chef/sync_environments_test.rb
|
108
|
+
- test/unit/chef/sync_roles_test.rb
|
109
|
+
- test/unit/chef/upload_cookbook_test.rb
|
110
|
+
- test/unit/chef/upload_data_bag_test.rb
|
111
|
+
- test/unit/chef/upload_environment_test.rb
|
112
|
+
- test/unit/chef/upload_role_test.rb
|
113
|
+
- test/unit/test_helper.rb
|
114
|
+
homepage: http://pantryops.org/chef
|
115
|
+
licenses:
|
116
|
+
- MIT
|
117
|
+
metadata: {}
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 2.0.0
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
requirements: []
|
133
|
+
rubyforge_project:
|
134
|
+
rubygems_version: 2.2.2
|
135
|
+
signing_key:
|
136
|
+
specification_version: 4
|
137
|
+
summary: Chef Plugin for Pantry
|
138
|
+
test_files:
|
139
|
+
- test/acceptance/chef/run_test.rb
|
140
|
+
- test/acceptance/chef/upload_cookbook_test.rb
|
141
|
+
- test/acceptance/chef/upload_data_bag_test.rb
|
142
|
+
- test/acceptance/chef/upload_environment_test.rb
|
143
|
+
- test/acceptance/chef/upload_role_test.rb
|
144
|
+
- test/acceptance/test_helper.rb
|
145
|
+
- test/fixtures/cookbooks/bad/recipes/default.rb
|
146
|
+
- test/fixtures/cookbooks/mini/metadata.rb
|
147
|
+
- test/fixtures/cookbooks/mini/recipes/default.rb
|
148
|
+
- test/fixtures/data_bags/settings/test.json
|
149
|
+
- test/fixtures/environments/test.rb
|
150
|
+
- test/fixtures/roles/app.rb
|
151
|
+
- test/fixtures/roles/app1.rb
|
152
|
+
- test/root_dir/applications/pantry/chef/roles/app.rb
|
153
|
+
- test/unit/chef/configure_chef_test.rb
|
154
|
+
- test/unit/chef/list_cookbooks_test.rb
|
155
|
+
- test/unit/chef/run_chef_solo_test.rb
|
156
|
+
- test/unit/chef/run_test.rb
|
157
|
+
- test/unit/chef/send_cookbooks_test.rb
|
158
|
+
- test/unit/chef/sync_cookbooks_test.rb
|
159
|
+
- test/unit/chef/sync_data_bags_test.rb
|
160
|
+
- test/unit/chef/sync_environments_test.rb
|
161
|
+
- test/unit/chef/sync_roles_test.rb
|
162
|
+
- test/unit/chef/upload_cookbook_test.rb
|
163
|
+
- test/unit/chef/upload_data_bag_test.rb
|
164
|
+
- test/unit/chef/upload_environment_test.rb
|
165
|
+
- test/unit/chef/upload_role_test.rb
|
166
|
+
- test/unit/test_helper.rb
|