opscode-pushy-client 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +88 -0
  3. data/Gemfile +20 -0
  4. data/Gemfile.lock +242 -0
  5. data/LICENSE +201 -0
  6. data/README.md +43 -0
  7. data/RELEASE_PROCESS.md +105 -0
  8. data/Rakefile +42 -0
  9. data/bin/print_execution_environment +18 -0
  10. data/bin/push-apply +47 -0
  11. data/bin/pushy-client +8 -0
  12. data/bin/pushy-service-manager +19 -0
  13. data/jenkins/jenkins_run_tests.sh +9 -0
  14. data/keys/client_private.pem +27 -0
  15. data/keys/server_public.pem +9 -0
  16. data/lib/pushy_client.rb +268 -0
  17. data/lib/pushy_client/cli.rb +168 -0
  18. data/lib/pushy_client/heartbeater.rb +153 -0
  19. data/lib/pushy_client/job_runner.rb +316 -0
  20. data/lib/pushy_client/periodic_reconfigurer.rb +62 -0
  21. data/lib/pushy_client/protocol_handler.rb +508 -0
  22. data/lib/pushy_client/version.rb +23 -0
  23. data/lib/pushy_client/whitelist.rb +66 -0
  24. data/lib/pushy_client/win32.rb +27 -0
  25. data/lib/pushy_client/windows_service.rb +253 -0
  26. data/omnibus/Berksfile +12 -0
  27. data/omnibus/Gemfile +15 -0
  28. data/omnibus/Gemfile.lock +232 -0
  29. data/omnibus/LICENSE +201 -0
  30. data/omnibus/README.md +141 -0
  31. data/omnibus/acceptance/Berksfile +6 -0
  32. data/omnibus/acceptance/Berksfile.lock +35 -0
  33. data/omnibus/acceptance/Makefile +13 -0
  34. data/omnibus/acceptance/README.md +29 -0
  35. data/omnibus/acceptance/metadata.rb +12 -0
  36. data/omnibus/acceptance/recipes/chef-server-user-org.rb +31 -0
  37. data/omnibus/config/projects/push-jobs-client.rb +83 -0
  38. data/omnibus/config/software/opscode-pushy-client.rb +78 -0
  39. data/omnibus/files/mapfiles/solaris +18 -0
  40. data/omnibus/files/openssl-customization/windows/ssl_env_hack.rb +34 -0
  41. data/omnibus/omnibus.rb +54 -0
  42. data/omnibus/package-scripts/push-jobs-client/postinst +55 -0
  43. data/omnibus/package-scripts/push-jobs-client/postrm +39 -0
  44. data/omnibus/resources/push-jobs-client/dmg/background.png +0 -0
  45. data/omnibus/resources/push-jobs-client/dmg/icon.png +0 -0
  46. data/omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf +197 -0
  47. data/omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp +0 -0
  48. data/omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp +0 -0
  49. data/omnibus/resources/push-jobs-client/msi/assets/oc.ico +0 -0
  50. data/omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico +0 -0
  51. data/omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico +0 -0
  52. data/omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb +26 -0
  53. data/omnibus/resources/push-jobs-client/msi/parameters.wxi.erb +9 -0
  54. data/omnibus/resources/push-jobs-client/msi/source.wxs.erb +138 -0
  55. data/omnibus/resources/push-jobs-client/pkg/background.png +0 -0
  56. data/omnibus/resources/push-jobs-client/pkg/license.html.erb +202 -0
  57. data/omnibus/resources/push-jobs-client/pkg/welcome.html.erb +5 -0
  58. data/opscode-pushy-client.gemspec +28 -0
  59. data/pkg/opscode-pushy-client-2.3.0.gem +0 -0
  60. data/spec/pushy_client/protocol_handler_spec.rb +48 -0
  61. data/spec/pushy_client/whitelist_spec.rb +70 -0
  62. data/spec/spec_helper.rb +12 -0
  63. metadata +235 -0
@@ -0,0 +1,70 @@
1
+ require 'spec_helper'
2
+ require 'pushy_client/whitelist'
3
+
4
+ describe PushyClient::Whitelist do
5
+ let(:whitelist) do
6
+ {
7
+ "chef-client" => "chef-client",
8
+ /^deliverance (.+)$/ => 'deliverance eats at \1',
9
+ /^hard (.+)$/ => {
10
+ :lock => true,
11
+ :command_line => 'tastes like \1'
12
+ }
13
+ }
14
+ end
15
+
16
+ let(:pcw) do
17
+ PushyClient::Whitelist.new(whitelist)
18
+ end
19
+
20
+ describe "initialize" do
21
+ it "takes a whitelist hash and stores it in an instance attr" do
22
+ pcw = PushyClient::Whitelist.new(whitelist)
23
+ expect(pcw.whitelist).to eq(whitelist)
24
+ end
25
+ end
26
+
27
+ describe "[]" do
28
+ let(:pcw) do
29
+ PushyClient::Whitelist.new(whitelist)
30
+ end
31
+
32
+ it "returns the exact match if it has one" do
33
+ expect(pcw["chef-client"]).to eq("chef-client")
34
+ end
35
+
36
+ describe "evaluates regular expressions if no exact match" do
37
+ describe "and the value is a string" do
38
+ it "evaluates regular expression, returning the value string gsub-ed" do
39
+ expect(pcw["deliverance lunchtime"]).to eq("deliverance eats at lunchtime")
40
+ end
41
+ end
42
+
43
+ describe "and the value is a hash" do
44
+ it "evaluates the regular expression, returning the hash with command_line entry gsub-ed" do
45
+ expect(pcw["hard chicken"]).to eq({ :lock => true, :command_line => "tastes like chicken"})
46
+ end
47
+ end
48
+
49
+ it "skips non-matching keys" do
50
+ expect(pcw["you do not match"]).to eq(nil)
51
+ end
52
+ end
53
+ end
54
+
55
+ describe "works for regular hash methods" do
56
+ it "supports non-block methods" do
57
+ expect(pcw.keys).to eq(whitelist.keys)
58
+ end
59
+
60
+ it "supports block methods" do
61
+ seen = {}
62
+ pcw.each do |key, value|
63
+ seen[key] = value
64
+ end
65
+ expect(pcw.whitelist).to eq(seen)
66
+ end
67
+ end
68
+
69
+
70
+ end
@@ -0,0 +1,12 @@
1
+ $: << File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
2
+
3
+ # This file was generated by the `rspec --init` command. Conventionally, all
4
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
+ # Require this file using `require "spec_helper"` to ensure that it is only
6
+ # loaded once.
7
+ #
8
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
9
+ RSpec.configure do |config|
10
+ config.run_all_when_everything_filtered = true
11
+ config.filter_run :focus
12
+ end
metadata ADDED
@@ -0,0 +1,235 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: opscode-pushy-client
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Mark Anderson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: chef
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '12.19'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '14.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '12.19'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '14.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: ohai
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '8.23'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '14.0'
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '8.23'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '14.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: ffi-rzmq
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ - !ruby/object:Gem::Dependency
68
+ name: uuidtools
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rake
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: rdoc
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: rspec
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: rspec_junit_formatter
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ description: Client for Chef push jobs server
138
+ email:
139
+ - mark@chef.io
140
+ executables:
141
+ - print_execution_environment
142
+ - push-apply
143
+ - pushy-client
144
+ - pushy-service-manager
145
+ extensions: []
146
+ extra_rdoc_files: []
147
+ files:
148
+ - CHANGELOG.md
149
+ - Gemfile
150
+ - Gemfile.lock
151
+ - LICENSE
152
+ - README.md
153
+ - RELEASE_PROCESS.md
154
+ - Rakefile
155
+ - bin/print_execution_environment
156
+ - bin/push-apply
157
+ - bin/pushy-client
158
+ - bin/pushy-service-manager
159
+ - jenkins/jenkins_run_tests.sh
160
+ - keys/client_private.pem
161
+ - keys/server_public.pem
162
+ - lib/pushy_client.rb
163
+ - lib/pushy_client/cli.rb
164
+ - lib/pushy_client/heartbeater.rb
165
+ - lib/pushy_client/job_runner.rb
166
+ - lib/pushy_client/periodic_reconfigurer.rb
167
+ - lib/pushy_client/protocol_handler.rb
168
+ - lib/pushy_client/version.rb
169
+ - lib/pushy_client/whitelist.rb
170
+ - lib/pushy_client/win32.rb
171
+ - lib/pushy_client/windows_service.rb
172
+ - omnibus/Berksfile
173
+ - omnibus/Gemfile
174
+ - omnibus/Gemfile.lock
175
+ - omnibus/LICENSE
176
+ - omnibus/README.md
177
+ - omnibus/acceptance/Berksfile
178
+ - omnibus/acceptance/Berksfile.lock
179
+ - omnibus/acceptance/Makefile
180
+ - omnibus/acceptance/README.md
181
+ - omnibus/acceptance/metadata.rb
182
+ - omnibus/acceptance/recipes/chef-server-user-org.rb
183
+ - omnibus/config/projects/push-jobs-client.rb
184
+ - omnibus/config/software/opscode-pushy-client.rb
185
+ - omnibus/files/mapfiles/solaris
186
+ - omnibus/files/openssl-customization/windows/ssl_env_hack.rb
187
+ - omnibus/omnibus.rb
188
+ - omnibus/package-scripts/push-jobs-client/postinst
189
+ - omnibus/package-scripts/push-jobs-client/postrm
190
+ - omnibus/resources/push-jobs-client/dmg/background.png
191
+ - omnibus/resources/push-jobs-client/dmg/icon.png
192
+ - omnibus/resources/push-jobs-client/msi/assets/LICENSE.rtf
193
+ - omnibus/resources/push-jobs-client/msi/assets/banner_background.bmp
194
+ - omnibus/resources/push-jobs-client/msi/assets/dialog_background.bmp
195
+ - omnibus/resources/push-jobs-client/msi/assets/oc.ico
196
+ - omnibus/resources/push-jobs-client/msi/assets/oc_16x16.ico
197
+ - omnibus/resources/push-jobs-client/msi/assets/oc_32x32.ico
198
+ - omnibus/resources/push-jobs-client/msi/localization-en-us.wxl.erb
199
+ - omnibus/resources/push-jobs-client/msi/parameters.wxi.erb
200
+ - omnibus/resources/push-jobs-client/msi/source.wxs.erb
201
+ - omnibus/resources/push-jobs-client/pkg/background.png
202
+ - omnibus/resources/push-jobs-client/pkg/license.html.erb
203
+ - omnibus/resources/push-jobs-client/pkg/welcome.html.erb
204
+ - opscode-pushy-client.gemspec
205
+ - pkg/opscode-pushy-client-2.3.0.gem
206
+ - spec/pushy_client/protocol_handler_spec.rb
207
+ - spec/pushy_client/whitelist_spec.rb
208
+ - spec/spec_helper.rb
209
+ homepage: https://github.com/chef/opscode-pushy-client
210
+ licenses: []
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '2.2'
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.6.11
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: Client for Chef push jobs server
232
+ test_files:
233
+ - spec/pushy_client/protocol_handler_spec.rb
234
+ - spec/pushy_client/whitelist_spec.rb
235
+ - spec/spec_helper.rb