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,6 +0,0 @@
1
- chef_server_url 'http://127.0.0.1:4000'
2
- node_name 'test-node'
3
- client_key 'test_client.pem'
4
- chef_repo_path 'spec/unit/fixtures'
5
- cookbook_path 'spec/unit/fixtures/cookbooks'
6
- cache_options( :path => 'checksums' )
@@ -1,27 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- MIIEowIBAAKCAQEA6NLSaRTs1vQEuFhhBjaEuVzrPoz59U+8w8bhyL5sXXzFatVm
3
- t1uCtmOaaqE8QsOQG2rdaoW/YXjErg/xyzW3Z0q++RekYx6guvTbpKHoSzgqG8AJ
4
- wpVXn9wXKRgOHpGCvyaqMNvHpEmQdjJfFTZ5yJtDdRQbWMincs14VbuVlNniMmmF
5
- thw3lMgPpEs/tf7a+V23BroYBCslsAoQb4Sb4kIVVWLAuBXOdfRxOY0XH/lqKn9w
6
- r4/Lh6Iw3Sf6zVUI0WhBhhohP2aQhZu3CwA+B2wmEcaUrnVwuJJZcJ5NEwa7ysXk
7
- AGh4erlxl8vK7lbootF/vnvLqrYEdaleINGflwIDAQABAoIBAF/t9ao8Z/WNZ6B5
8
- Mcj4j6k8guUr+xW7fACCoqcu5sGCVmlVclQcTXhPA+Hpe0XbBDZ3yrFIWHmV5BwA
9
- D9V11ZKmtpc1yZLZnMpLd3CXEXpkstzqPFtDY25HpfdVpQOtWtzd1oP5GoIzmWVK
10
- DelUn8srRhkoZrgnPO9Nf8Z7Wv+QGaanGyiTvEbP3/ZYbKs6aXMkF1eJf1iubUWq
11
- jgtN9dGyvglhKNMNxo2O88MJOPWqmwrdYQGbCXJ2aPcjchRVQrdr55yaCvP9QV3P
12
- TIqJwsIS6fvpuhTfjpIjGKtClWubh9sVS74G9HOus908u8VQLizjkeWa3Tmcqk+t
13
- a8HJQZECgYEA+lk4osTUbSOQu3tSLwNoDLL1pJnJ2bZ/SM1O6yLTbpqom0dyh/xC
14
- ffy+iua9Ngu7dHJDc69FxqPhLlWl2KzZKvh1V7J/TVBcknVP84OKSBttc4pWN5Zv
15
- jkOoewI3e+0RA2Gx3+QuLea6iaV0lZ7pq5rbQv49z3qa2glCr6q4iykCgYEA7hRS
16
- nDPaXnvBxglv9YobXTmkB/ZxsLO4h3Tm5CHoKYTp4f8oEaJnGVd0lzp3aGw3DSac
17
- Z8xdStTe+6HBeFDIjaVjb693+2aE1iGoZMry93zZd5mxBS0XiG72hu7ZfFzthl3v
18
- 72lTTj2xpRTt17p/xwl7LITPxGtl0ychUY0Y7L8CgYAz/lG35F8l54wIk/0mjHOQ
19
- p55CuDnmwHNBAHrSdOIqh25bCYSs32RD3DkKig9j6R3eelit7wnzzldXEyyliohz
20
- 1zQvqX+s4/LF7B1Vusz+WsvpgiKT2ueCSWT1Xyl80GiHJkQV9sLsf43gRn+nD2EC
21
- ZeAB0uGtdI4ymFfEOhWnuQKBgDyZ+7U7Fbi7M8XfHRqZPwHp7DECsEnUVYJVZXho
22
- kRoQdSBLvL1QY4H12v2rqj1wXksAqwtY395udRwEPqULmyFDGh6Rwa7Cl8mR47VU
23
- W6hXpVtmScMRiU33QNVz8vRPCz8KpkqAuu3Nkmx8+VXSaTgW172rSN+snsyyxy5l
24
- BhUtAoGBAOr4jeJKT0jzeDJwLhrxctZkSkka0wCPe17d0+IfBbZ+XyQXFt+enuH1
25
- cMZ8IJr+nKHojjey7AunhYBtwQEv50Ul8TfvjUuqUY34xSVRAZD90LETZTVsq2QF
26
- q3wN75pqCHF55t/L5K2drAIxcfhBo/olgTvN91vGYXNieFh9PREl
27
- -----END RSA PRIVATE KEY-----
@@ -1,75 +0,0 @@
1
- require 'spec_helper'
2
- require 'chef/knife/spork-bump'
3
- require 'knife-spork/runner'
4
- require 'fileutils'
5
-
6
- module KnifeSpork
7
- describe SporkBump do
8
-
9
- let(:stdout_io) { StringIO.new }
10
- let(:stderr_io) { StringIO.new }
11
-
12
- subject(:knife) do
13
- SporkBump.new(argv).tap do |c|
14
- allow(c.ui).to receive(:stdout).and_return(stdout_io)
15
- end
16
- end
17
-
18
- before(:all) do
19
- copy_test_data
20
- end
21
-
22
- after(:all) do
23
- cleanup_test_data
24
- end
25
-
26
- let(:argv) { ["example"] }
27
-
28
- let(:metadata_file) { "#{cookbook_path}/example/metadata.rb" }
29
-
30
- describe '#run' do
31
- before(:each) { set_chef_config }
32
- it 'calls bump method' do
33
- expect(knife).to receive(:bump)
34
- knife.run
35
- end
36
- end
37
-
38
- describe '#bump' do
39
- before(:each) { set_chef_config }
40
- it 'automatically bumps patch level' do
41
- knife.instance_variable_set(:@cookbook, knife.load_cookbook(argv.first))
42
- knife.send(:bump)
43
- File.read(metadata_file).should include "version \"0.0.2\""
44
- end
45
-
46
- it 'manually bumps patch version level' do
47
- knife.instance_variable_set(:@cookbook, knife.load_cookbook(argv.first))
48
- knife.instance_variable_set(:@name_args, ["example","patch"])
49
- knife.send(:bump)
50
- File.read(metadata_file).should include "version \"0.0.3\""
51
- end
52
-
53
- it 'manually bumps minor version level' do
54
- knife.instance_variable_set(:@cookbook, knife.load_cookbook(argv.first))
55
- knife.instance_variable_set(:@name_args, ["example","minor"])
56
- knife.send(:bump)
57
- File.read(metadata_file).should include "version \"0.1.0\""
58
- end
59
-
60
- it 'manually bumps major version level' do
61
- knife.instance_variable_set(:@cookbook, knife.load_cookbook(argv.first))
62
- knife.instance_variable_set(:@name_args, ["example","major"])
63
- knife.send(:bump)
64
- File.read(metadata_file).should include "version \"1.0.0\""
65
- end
66
-
67
- it 'manually sets version to 0.0.1' do
68
- knife.instance_variable_set(:@cookbook, knife.load_cookbook(argv.first))
69
- knife.instance_variable_set(:@name_args, ["example", "manual", "0.0.1"])
70
- knife.send(:bump)
71
- File.read(metadata_file).should include "version \"0.0.1\""
72
- end
73
- end
74
- end
75
- end
@@ -1,40 +0,0 @@
1
- require 'spec_helper'
2
- require 'chef/knife/spork-info'
3
- require 'knife-spork/runner'
4
-
5
- module KnifeSpork
6
- describe SporkInfo do
7
-
8
- let(:stdout_io) { StringIO.new }
9
- let(:stderr_io) { StringIO.new }
10
-
11
- subject(:knife) do
12
- SporkInfo.new(argv).tap do |c|
13
- allow(c.ui).to receive(:stdout).and_return(stdout_io)
14
- end
15
- end
16
-
17
- let(:argv) { [] }
18
-
19
- describe '#run' do
20
- it 'displays spork info' do
21
- expect(knife).to receive(:info)
22
- knife.run
23
- end
24
- end
25
-
26
- describe '#info' do
27
- before(:each) { set_chef_config }
28
- let(:fake_ui) { double(:ui, msg: nil) }
29
-
30
- before do
31
- allow(knife).to receive(:ui) { fake_ui }
32
- end
33
-
34
- it 'only calls ui.msg' do
35
- expect(fake_ui).to receive(:msg)
36
- knife.send(:info)
37
- end
38
- end
39
- end
40
- end
@@ -1,77 +0,0 @@
1
- require 'spec_helper'
2
- require 'chef/knife/spork-promote'
3
- require 'knife-spork/runner'
4
-
5
- module KnifeSpork
6
- describe SporkPromote do
7
-
8
- let(:stdout_io) { StringIO.new }
9
- let(:stderr_io) { StringIO.new }
10
-
11
- before(:all) do
12
- copy_test_data
13
- end
14
-
15
- after(:all) do
16
- cleanup_test_data
17
- end
18
-
19
- subject(:knife) do
20
- SporkPromote.new(argv).tap do |c|
21
- allow(c.ui).to receive(:stdout).and_return(stdout_io)
22
- end
23
- end
24
-
25
- let(:environment_file) { "#{environment_path}/example.json" }
26
-
27
- let(:argv) { ["example", "example"] }
28
-
29
- describe '#run' do
30
- before(:each) { set_chef_config }
31
- it 'calls promote method' do
32
- expect(knife).to receive(:promote)
33
- knife.run
34
- end
35
-
36
- it 'calls save_environment_changes method by default' do
37
- expect(knife).to receive(:save_environment_changes)
38
- knife.run
39
- end
40
-
41
- it 'calls save_environment_changes_remote method when --remote is specified' do
42
- knife.config[:remote] = true
43
- expect(knife).to receive(:save_environment_changes_remote)
44
- knife.run
45
- end
46
- end
47
-
48
- describe '#promote' do
49
- before(:each) { set_chef_config }
50
- it 'updates version constraint for cookbook' do
51
- knife.instance_variable_set(:@environments, ["example"])
52
- knife.instance_variable_set(:@cookbook, "example")
53
- expect(knife).to receive(:update_version_constraints)
54
- knife.send(:promote, knife.load_environment_from_file("example"), "example")
55
- end
56
- end
57
-
58
- describe '#save_environment_changes' do
59
- before(:each) { set_chef_config }
60
- it 'updates the constraint in the environment file' do
61
- knife.instance_variable_set(:@environments, ["example"])
62
- knife.instance_variable_set(:@cookbook, "example")
63
- knife.send(:save_environment_changes, "example", knife.pretty_print_json(knife.load_environment_from_file("example").to_hash))
64
- File.read(environment_file).should include "\"example\": \"= 0.0.1\""
65
- end
66
- end
67
-
68
- describe '#save_environment_changes_remote' do
69
- before(:each) { set_chef_config }
70
- it 'saves the environment change to the server' do
71
- knife.instance_variable_set(:@environments, ["example"])
72
- knife.instance_variable_set(:@cookbook, "example")
73
- knife.send(:save_environment_changes_remote, "example")
74
- end
75
- end
76
- end
77
- end
@@ -1,46 +0,0 @@
1
- require 'spec_helper'
2
- require 'chef/knife/spork-upload'
3
- require 'chef/cookbook_uploader'
4
- require 'knife-spork/runner'
5
-
6
- module KnifeSpork
7
- describe SporkUpload do
8
-
9
- let(:stdout_io) { StringIO.new }
10
- let(:stderr_io) { StringIO.new }
11
-
12
- before(:all) do
13
- copy_test_data
14
- end
15
-
16
- after(:all) do
17
- cleanup_test_data
18
- end
19
-
20
- subject(:knife) do
21
- SporkUpload.new(argv).tap do |c|
22
- allow(c.ui).to receive(:stdout).and_return(stdout_io)
23
- end
24
- end
25
-
26
- let(:argv) { ["example"] }
27
-
28
- describe '#run' do
29
- before(:each) { set_chef_config }
30
- it 'calls upload method' do
31
- expect(knife).to receive(:upload)
32
- knife.run
33
- end
34
- end
35
-
36
- describe '#upload' do
37
- before(:each) { set_chef_config }
38
- it 'uploads cookbook' do # and negotiates protocol version
39
- knife.instance_variable_set(:@cookbooks, knife.load_cookbooks(argv))
40
- knife.send(:upload)
41
- ### for some reason could not make this expectation pass
42
- # expect(Chef::CookbookVersion).to receive(:list_all_version)
43
- end
44
- end
45
- end
46
- end