knife-solo 0.3.0.pre2 → 0.3.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/CHANGELOG.md +70 -27
  2. data/README.rdoc +11 -6
  3. data/Rakefile +4 -2
  4. data/lib/chef/knife/bootstrap_solo.rb +40 -0
  5. data/lib/chef/knife/solo_bootstrap.rb +1 -1
  6. data/lib/chef/knife/solo_clean.rb +16 -4
  7. data/lib/chef/knife/solo_cook.rb +111 -36
  8. data/lib/chef/knife/solo_init.rb +14 -0
  9. data/lib/chef/knife/solo_prepare.rb +1 -1
  10. data/lib/knife-solo/bootstraps.rb +0 -18
  11. data/lib/knife-solo/bootstraps/darwin.rb +4 -16
  12. data/lib/knife-solo/bootstraps/linux.rb +36 -48
  13. data/lib/knife-solo/info.rb +1 -1
  14. data/lib/knife-solo/resources/knife.rb +4 -0
  15. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/.travis.yml +7 -0
  16. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/CHANGELOG +16 -0
  17. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/LICENSE +202 -0
  18. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/NOTICE +18 -0
  19. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/README.md +141 -0
  20. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/search.rb +72 -0
  21. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/search/overrides.rb +99 -0
  22. data/lib/{chef/knife/patches → knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/search}/parser.rb +1 -2
  23. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene.treetop +150 -0
  24. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/lucene_nodes.rb +285 -0
  25. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/libraries/vendor/chef/solr_query/query_transform.rb +65 -0
  26. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/metadata.rb +11 -0
  27. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/recipes/default.rb +2 -0
  28. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/Gemfile +8 -0
  29. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/node/alpha.json +10 -0
  30. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/node/beta.json +10 -0
  31. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/node/without_json_class.json +7 -0
  32. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/users/jerry.json +8 -0
  33. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/users/lea.json +10 -0
  34. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/users/mike.json +13 -0
  35. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/data/data_bags/users/tom.json +10 -0
  36. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/test_data_bags.rb +44 -0
  37. data/lib/knife-solo/resources/patch_cookbooks/chef-solo-search/tests/test_search.rb +241 -0
  38. data/lib/knife-solo/resources/solo.rb.erb +10 -0
  39. data/lib/knife-solo/ssh_command.rb +4 -3
  40. data/lib/knife-solo/tools.rb +22 -0
  41. data/test/bootstraps_test.rb +4 -11
  42. data/test/integration/cases/encrypted_data_bag.rb +3 -0
  43. data/test/integration/cases/knife_bootstrap.rb +14 -0
  44. data/test/integration/debian6_bootstrap_test.rb +1 -1
  45. data/test/integration/{debian7_bootstrap_test.rb → debian7_knife_bootstrap_test.rb} +3 -3
  46. data/test/knife_bootstrap_test.rb +61 -0
  47. data/test/solo_cook_test.rb +78 -3
  48. data/test/support/integration_test.rb +8 -3
  49. data/test/tools_test.rb +82 -0
  50. metadata +63 -21
  51. data/lib/chef/knife/patches/search.rb +0 -110
  52. data/lib/knife-solo/config.rb +0 -39
  53. data/lib/knife-solo/resources/solo.rb +0 -6
  54. data/test/knife-solo/config_test.rb +0 -38
@@ -1,39 +0,0 @@
1
- require 'chef/config'
2
-
3
- module KnifeSolo
4
- # Encapsulates some logic for checking and extracting
5
- # path configuration from the structure of the
6
- # current kitchen
7
- class Config
8
- def solo_path
9
- Chef::Config.knife[:solo_path]
10
- end
11
-
12
- def chef_path
13
- solo_path || './chef-solo'
14
- end
15
-
16
- def cookbook_path
17
- if using_custom_solorb?
18
- Chef::Config.from_file('solo.rb')
19
- Array(Chef::Config.cookbook_path).first
20
- else
21
- chef_path + '/cookbooks'
22
- end
23
- end
24
-
25
- def patch_path
26
- cookbook_path + "/chef_solo_patches/libraries"
27
- end
28
-
29
- def using_custom_solorb?
30
- File.exist?('solo.rb')
31
- end
32
-
33
- def validate!
34
- raise Error, "You have a solo.rb file, but knife[:solo_path] is not set. You probably need to delete solo.rb unless you've customized it. See https://github.com/matschaffer/knife-solo/wiki/Upgrading-to-0.3.0 for more information." if using_custom_solorb? && solo_path.nil?
35
- end
36
-
37
- class Error < StandardError; end
38
- end
39
- end
@@ -1,6 +0,0 @@
1
- base = File.expand_path('..', __FILE__)
2
-
3
- data_bag_path base + '/data_bags'
4
- encrypted_data_bag_secret base + '/data_bag_key'
5
- role_path base + '/roles'
6
- cookbook_path [ base + '/site-cookbooks', base + '/cookbooks' ]
@@ -1,38 +0,0 @@
1
- require 'test_helper'
2
- require 'knife-solo/config'
3
-
4
- class KnifeSoloConfigTest < TestCase
5
- def setup
6
- super
7
- @config = KnifeSolo::Config.new
8
- end
9
-
10
- def teardown
11
- super
12
- FileUtils.rm_f 'solo.rb'
13
- end
14
-
15
- def test_uses_cookbook_path_from_solo_rb_if_available
16
- write_file('solo.rb', <<-RUBY)
17
- knife[:solo_path] = "./custom"
18
- cookbook_path ["./custom/path"]
19
- RUBY
20
- assert_equal "./custom/path", @config.cookbook_path
21
- end
22
-
23
- def test_reads_chef_root_path_from_knife_config_or_defaults_to_home
24
- assert_equal './chef-solo', @config.chef_path
25
- Chef::Config.knife[:solo_path] = "/tmp/custom-chef-solo"
26
- assert_equal "/tmp/custom-chef-solo", @config.chef_path
27
- end
28
-
29
- def test_fails_validation_if_user_has_solo_rb_and_no_solo_path
30
- Chef::Config.knife[:solo_path] = nil
31
- write_file('solo.rb', <<-RUBY)
32
- cookbook_path ["custom/path"]
33
- RUBY
34
- assert_raises KnifeSolo::Config::Error do
35
- @config.validate!
36
- end
37
- end
38
- end