knife-spork 1.7.2 → 1.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +35 -35
  3. data/lib/chef/knife/spork-bump.rb +100 -100
  4. data/lib/chef/knife/spork-check.rb +165 -161
  5. data/lib/chef/knife/spork-databag-create.rb +54 -54
  6. data/lib/chef/knife/spork-databag-delete.rb +51 -51
  7. data/lib/chef/knife/spork-databag-edit.rb +54 -54
  8. data/lib/chef/knife/spork-databag-fromfile.rb +88 -88
  9. data/lib/chef/knife/spork-delete.rb +132 -132
  10. data/lib/chef/knife/spork-environment-check.rb +90 -90
  11. data/lib/chef/knife/spork-environment-create.rb +63 -63
  12. data/lib/chef/knife/spork-environment-delete.rb +38 -38
  13. data/lib/chef/knife/spork-environment-edit.rb +40 -40
  14. data/lib/chef/knife/spork-environment-fromfile.rb +46 -46
  15. data/lib/chef/knife/spork-info.rb +34 -34
  16. data/lib/chef/knife/spork-node-create.rb +41 -41
  17. data/lib/chef/knife/spork-node-delete.rb +41 -41
  18. data/lib/chef/knife/spork-node-edit.rb +48 -48
  19. data/lib/chef/knife/spork-node-fromfile.rb +46 -46
  20. data/lib/chef/knife/spork-node-runlistadd.rb +51 -51
  21. data/lib/chef/knife/spork-node-runlistremove.rb +44 -44
  22. data/lib/chef/knife/spork-node-runlistset.rb +44 -44
  23. data/lib/chef/knife/spork-omni.rb +112 -112
  24. data/lib/chef/knife/spork-promote.rb +197 -197
  25. data/lib/chef/knife/spork-role-create.rb +46 -46
  26. data/lib/chef/knife/spork-role-delete.rb +50 -50
  27. data/lib/chef/knife/spork-role-edit.rb +40 -40
  28. data/lib/chef/knife/spork-role-fromfile.rb +65 -65
  29. data/lib/chef/knife/spork-upload.rb +151 -151
  30. data/lib/chef/knife/spork-version.rb +12 -12
  31. data/lib/knife-spork.rb +3 -3
  32. data/lib/knife-spork/plugins.rb +27 -27
  33. data/lib/knife-spork/plugins/campfire.rb +219 -219
  34. data/lib/knife-spork/plugins/eventinator.rb +329 -329
  35. data/lib/knife-spork/plugins/foodcritic.rb +46 -46
  36. data/lib/knife-spork/plugins/git.rb +393 -399
  37. data/lib/knife-spork/plugins/graphite.rb +25 -25
  38. data/lib/knife-spork/plugins/grove.rb +167 -167
  39. data/lib/knife-spork/plugins/hipchat.rb +171 -171
  40. data/lib/knife-spork/plugins/influxdb.rb +28 -28
  41. data/lib/knife-spork/plugins/irccat.rb +332 -332
  42. data/lib/knife-spork/plugins/jabber.rb +133 -133
  43. data/lib/knife-spork/plugins/plugin.rb +117 -117
  44. data/lib/knife-spork/plugins/rubocop.rb +56 -56
  45. data/lib/knife-spork/plugins/slack.rb +125 -125
  46. data/lib/knife-spork/plugins/statusnet.rb +122 -122
  47. data/lib/knife-spork/runner.rb +342 -342
  48. data/lib/knife-spork/version.rb +5 -5
  49. metadata +4 -51
  50. data/.gitignore +0 -21
  51. data/.ruby-gemset +0 -1
  52. data/.ruby-version +0 -1
  53. data/.travis.yml +0 -3
  54. data/CHANGELOG.md +0 -445
  55. data/Gemfile +0 -3
  56. data/README.md +0 -544
  57. data/Rakefile +0 -35
  58. data/knife-spork.gemspec +0 -28
  59. data/plugins/Campfire.md +0 -43
  60. data/plugins/Eventinator.md +0 -30
  61. data/plugins/Foodcritic.md +0 -53
  62. data/plugins/Git.md +0 -53
  63. data/plugins/Graphite.md +0 -30
  64. data/plugins/Grove.md +0 -31
  65. data/plugins/HipChat.md +0 -69
  66. data/plugins/Influxdb.md +0 -25
  67. data/plugins/Irccat.md +0 -50
  68. data/plugins/Jabber.md +0 -61
  69. data/plugins/README.md +0 -70
  70. data/plugins/Rubocop.md +0 -110
  71. data/plugins/Slack.md +0 -48
  72. data/plugins/StatusNet.md +0 -41
  73. data/plugins/Template.md +0 -34
  74. data/spec/spec_helper.rb +0 -10
  75. data/spec/test_helpers.rb +0 -46
  76. data/spec/unit/fixtures/config/spork-config.yml +0 -1
  77. data/spec/unit/fixtures/cookbooks/example/metadata.rb +0 -8
  78. data/spec/unit/fixtures/environments/example.json +0 -12
  79. data/spec/unit/fixtures/knife.rb +0 -6
  80. data/spec/unit/fixtures/test_client.pem +0 -27
  81. data/spec/unit/spork_bump_spec.rb +0 -75
  82. data/spec/unit/spork_info_spec.rb +0 -40
  83. data/spec/unit/spork_promote_spec.rb +0 -77
  84. data/spec/unit/spork_upload_spec.rb +0 -46
@@ -1,38 +1,38 @@
1
- module KnifeSpork
2
- class SporkEnvironmentDelete < Chef::Knife
3
-
4
- deps do
5
- require 'chef/knife'
6
- require 'knife-spork/runner'
7
- end
8
-
9
- banner 'knife spork environment delete ENVIRONMENT (options)'
10
-
11
- def run
12
- self.class.send(:include, KnifeSpork::Runner)
13
- self.config = Chef::Config.merge!(config)
14
-
15
- if @name_args.empty?
16
- show_usage
17
- ui.error("You must specify a environment name")
18
- exit 1
19
- end
20
-
21
- @object_name = @name_args.first
22
-
23
- run_plugins(:before_environmentdelete)
24
- pre_environment = load_environment(@object_name)
25
- environment_delete
26
- post_environment = {}
27
- @object_difference = json_diff(pre_environment,post_environment).to_s
28
- run_plugins(:after_environmentdelete)
29
- end
30
-
31
- private
32
- def environment_delete
33
- rd = Chef::Knife::EnvironmentDelete.new
34
- rd.name_args = @name_args
35
- rd.run
36
- end
37
- end
38
- end
1
+ module KnifeSpork
2
+ class SporkEnvironmentDelete < Chef::Knife
3
+
4
+ deps do
5
+ require 'chef/knife'
6
+ require 'knife-spork/runner'
7
+ end
8
+
9
+ banner 'knife spork environment delete ENVIRONMENT (options)'
10
+
11
+ def run
12
+ self.class.send(:include, KnifeSpork::Runner)
13
+ self.config = Chef::Config.merge!(config)
14
+
15
+ if @name_args.empty?
16
+ show_usage
17
+ ui.error("You must specify a environment name")
18
+ exit 1
19
+ end
20
+
21
+ @object_name = @name_args.first
22
+
23
+ run_plugins(:before_environmentdelete)
24
+ pre_environment = load_environment(@object_name)
25
+ environment_delete
26
+ post_environment = {}
27
+ @object_difference = json_diff(pre_environment,post_environment).to_s
28
+ run_plugins(:after_environmentdelete)
29
+ end
30
+
31
+ private
32
+ def environment_delete
33
+ rd = Chef::Knife::EnvironmentDelete.new
34
+ rd.name_args = @name_args
35
+ rd.run
36
+ end
37
+ end
38
+ end
@@ -1,40 +1,40 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkEnvironmentEdit < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork environment edit ENVIRONMENT (options)'
11
-
12
- def run
13
- self.class.send(:include, KnifeSpork::Runner)
14
- self.config = Chef::Config.merge!(config)
15
-
16
- if @name_args.empty?
17
- show_usage
18
- ui.error("You must specify a environment name")
19
- exit 1
20
- end
21
-
22
- @object_name = @name_args.first
23
-
24
- run_plugins(:before_environmentedit)
25
- pre_environment = load_environment(@object_name)
26
- environment_edit
27
- post_environment = load_environment(@object_name)
28
- @object_difference = json_diff(pre_environment,post_environment).to_s
29
- run_plugins(:after_environmentedit)
30
- end
31
-
32
- private
33
- def environment_edit
34
- re = Chef::Knife::EnvironmentEdit.new
35
- re.name_args = @name_args
36
- re.config[:editor] = config[:editor]
37
- re.run
38
- end
39
- end
40
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkEnvironmentEdit < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork environment edit ENVIRONMENT (options)'
11
+
12
+ def run
13
+ self.class.send(:include, KnifeSpork::Runner)
14
+ self.config = Chef::Config.merge!(config)
15
+
16
+ if @name_args.empty?
17
+ show_usage
18
+ ui.error("You must specify a environment name")
19
+ exit 1
20
+ end
21
+
22
+ @object_name = @name_args.first
23
+
24
+ run_plugins(:before_environmentedit)
25
+ pre_environment = load_environment(@object_name)
26
+ environment_edit
27
+ post_environment = load_environment(@object_name)
28
+ @object_difference = json_diff(pre_environment,post_environment).to_s
29
+ run_plugins(:after_environmentedit)
30
+ end
31
+
32
+ private
33
+ def environment_edit
34
+ re = Chef::Knife::EnvironmentEdit.new
35
+ re.name_args = @name_args
36
+ re.config[:editor] = config[:editor]
37
+ re.run
38
+ end
39
+ end
40
+ end
@@ -1,46 +1,46 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkEnvironmentFromFile < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- require 'json'
9
- require 'chef/knife/environment_from_file'
10
- end
11
-
12
- banner 'knife spork environment from file FILENAME (options)'
13
-
14
- def run
15
- self.class.send(:include, KnifeSpork::Runner)
16
- self.config = Chef::Config.merge!(config)
17
-
18
- if @name_args.empty?
19
- show_usage
20
- ui.error("You must specify a environment name")
21
- exit 1
22
- end
23
-
24
- @name_args.each do |arg|
25
- @object_name = arg.split("/").last
26
- run_plugins(:before_environmentfromfile)
27
- begin
28
- pre_environment = load_environment(@object_name.gsub(".json","").gsub(".rb",""))
29
- rescue Net::HTTPServerException => e
30
- pre_environment = {}
31
- end
32
- environment_from_file
33
- post_environment = load_environment(@object_name.gsub(".json","").gsub(".rb",""))
34
- @object_difference = json_diff(pre_environment,post_environment).to_s
35
- run_plugins(:after_environmentfromfile)
36
- end
37
- end
38
-
39
- private
40
- def environment_from_file
41
- rff = Chef::Knife::EnvironmentFromFile.new
42
- rff.name_args = @name_args
43
- rff.run
44
- end
45
- end
46
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkEnvironmentFromFile < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ require 'json'
9
+ require 'chef/knife/environment_from_file'
10
+ end
11
+
12
+ banner 'knife spork environment from file FILENAME (options)'
13
+
14
+ def run
15
+ self.class.send(:include, KnifeSpork::Runner)
16
+ self.config = Chef::Config.merge!(config)
17
+
18
+ if @name_args.empty?
19
+ show_usage
20
+ ui.error("You must specify a environment name")
21
+ exit 1
22
+ end
23
+
24
+ @name_args.each do |arg|
25
+ @object_name = arg.split("/").last
26
+ run_plugins(:before_environmentfromfile)
27
+ begin
28
+ pre_environment = load_environment(@object_name.gsub(".json","").gsub(".rb",""))
29
+ rescue Net::HTTPServerException => e
30
+ pre_environment = {}
31
+ end
32
+ environment_from_file
33
+ post_environment = load_environment(@object_name.gsub(".json","").gsub(".rb",""))
34
+ @object_difference = json_diff(pre_environment,post_environment).to_s
35
+ run_plugins(:after_environmentfromfile)
36
+ end
37
+ end
38
+
39
+ private
40
+ def environment_from_file
41
+ rff = Chef::Knife::EnvironmentFromFile.new
42
+ rff.name_args = @name_args
43
+ rff.run
44
+ end
45
+ end
46
+ end
@@ -1,34 +1,34 @@
1
- require 'chef/knife'
2
- require 'yaml'
3
-
4
- module KnifeSpork
5
- class SporkInfo < Chef::Knife
6
-
7
- deps do
8
- require 'knife-spork/runner'
9
- end
10
-
11
- banner 'knife spork info'
12
-
13
- def run
14
- self.class.send(:include, KnifeSpork::Runner)
15
- self.config = Chef::Config.merge!(config)
16
-
17
- run_plugins(:before_info)
18
- info
19
- run_plugins(:after_info)
20
- end
21
-
22
- private
23
- def info
24
- ui.msg "Config Hash:"
25
- ui.msg spork_config.to_yaml
26
- ui.msg ""
27
- ui.msg "Plugins:"
28
- KnifeSpork::Plugins.klasses.each do |klass|
29
- plugin = klass.new(:config => spork_config)
30
- ui.msg "#{klass}: #{plugin.enabled? ? 'enabled' : 'disabled'}"
31
- end
32
- end
33
- end
34
- end
1
+ require 'chef/knife'
2
+ require 'yaml'
3
+
4
+ module KnifeSpork
5
+ class SporkInfo < Chef::Knife
6
+
7
+ deps do
8
+ require 'knife-spork/runner'
9
+ end
10
+
11
+ banner 'knife spork info'
12
+
13
+ def run
14
+ self.class.send(:include, KnifeSpork::Runner)
15
+ self.config = Chef::Config.merge!(config)
16
+
17
+ run_plugins(:before_info)
18
+ info
19
+ run_plugins(:after_info)
20
+ end
21
+
22
+ private
23
+ def info
24
+ ui.msg "Config Hash:"
25
+ ui.msg spork_config.to_yaml
26
+ ui.msg ""
27
+ ui.msg "Plugins:"
28
+ KnifeSpork::Plugins.klasses.each do |klass|
29
+ plugin = klass.new(:config => spork_config)
30
+ ui.msg "#{klass}: #{plugin.enabled? ? 'enabled' : 'disabled'}"
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,41 +1,41 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeCreate < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node create NODE (options)'
11
-
12
-
13
- def run
14
- self.class.send(:include, KnifeSpork::Runner)
15
- self.config = Chef::Config.merge!(config)
16
-
17
- if @name_args.empty?
18
- show_usage
19
- ui.error("You must specify a node name")
20
- exit 1
21
- end
22
-
23
- @object_name = @name_args.first
24
-
25
- run_plugins(:before_nodecreate)
26
- pre_node = {}
27
- node_create
28
- post_node = load_node(@object_name)
29
- @object_difference = json_diff(pre_node,post_node).to_s
30
- run_plugins(:after_nodecreate)
31
- end
32
-
33
- private
34
- def node_create
35
- ne = Chef::Knife::NodeCreate.new
36
- ne.name_args = @name_args
37
- ne.config[:editor] = config[:editor]
38
- ne.run
39
- end
40
- end
41
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeCreate < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node create NODE (options)'
11
+
12
+
13
+ def run
14
+ self.class.send(:include, KnifeSpork::Runner)
15
+ self.config = Chef::Config.merge!(config)
16
+
17
+ if @name_args.empty?
18
+ show_usage
19
+ ui.error("You must specify a node name")
20
+ exit 1
21
+ end
22
+
23
+ @object_name = @name_args.first
24
+
25
+ run_plugins(:before_nodecreate)
26
+ pre_node = {}
27
+ node_create
28
+ post_node = load_node(@object_name)
29
+ @object_difference = json_diff(pre_node,post_node).to_s
30
+ run_plugins(:after_nodecreate)
31
+ end
32
+
33
+ private
34
+ def node_create
35
+ ne = Chef::Knife::NodeCreate.new
36
+ ne.name_args = @name_args
37
+ ne.config[:editor] = config[:editor]
38
+ ne.run
39
+ end
40
+ end
41
+ end
@@ -1,41 +1,41 @@
1
- require 'chef/knife'
2
-
3
- module KnifeSpork
4
- class SporkNodeDelete < Chef::Knife
5
-
6
- deps do
7
- require 'knife-spork/runner'
8
- end
9
-
10
- banner 'knife spork node delete NODE (options)'
11
-
12
-
13
- def run
14
- self.class.send(:include, KnifeSpork::Runner)
15
- self.config = Chef::Config.merge!(config)
16
-
17
- if @name_args.empty?
18
- show_usage
19
- ui.error("You must specify a node name")
20
- exit 1
21
- end
22
-
23
- @object_name = @name_args.first
24
-
25
- run_plugins(:before_nodedelete)
26
- pre_node = load_node(@object_name)
27
- node_delete
28
- post_node = {}
29
- @object_difference = json_diff(pre_node,post_node).to_s
30
- run_plugins(:after_nodedelete)
31
- end
32
-
33
- private
34
- def node_delete
35
- ne = Chef::Knife::NodeDelete.new
36
- ne.name_args = @name_args
37
- ne.config[:editor] = config[:editor]
38
- ne.run
39
- end
40
- end
41
- end
1
+ require 'chef/knife'
2
+
3
+ module KnifeSpork
4
+ class SporkNodeDelete < Chef::Knife
5
+
6
+ deps do
7
+ require 'knife-spork/runner'
8
+ end
9
+
10
+ banner 'knife spork node delete NODE (options)'
11
+
12
+
13
+ def run
14
+ self.class.send(:include, KnifeSpork::Runner)
15
+ self.config = Chef::Config.merge!(config)
16
+
17
+ if @name_args.empty?
18
+ show_usage
19
+ ui.error("You must specify a node name")
20
+ exit 1
21
+ end
22
+
23
+ @object_name = @name_args.first
24
+
25
+ run_plugins(:before_nodedelete)
26
+ pre_node = load_node(@object_name)
27
+ node_delete
28
+ post_node = {}
29
+ @object_difference = json_diff(pre_node,post_node).to_s
30
+ run_plugins(:after_nodedelete)
31
+ end
32
+
33
+ private
34
+ def node_delete
35
+ ne = Chef::Knife::NodeDelete.new
36
+ ne.name_args = @name_args
37
+ ne.config[:editor] = config[:editor]
38
+ ne.run
39
+ end
40
+ end
41
+ end