opscode-pushy-client 2.3.0 → 2.4.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +50 -1
- data/Gemfile.lock +62 -59
- data/RELEASE_NOTES.md +9 -0
- data/RELEASE_PROCESS.md +1 -1
- data/VERSION +1 -0
- data/lib/pushy_client.rb +46 -8
- data/lib/pushy_client/cli.rb +2 -1
- data/lib/pushy_client/job_runner.rb +3 -0
- data/lib/pushy_client/periodic_reconfigurer.rb +27 -4
- data/lib/pushy_client/protocol_handler.rb +28 -6
- data/lib/pushy_client/version.rb +1 -1
- data/lib/pushy_client/windows_service.rb +11 -9
- data/omnibus/Gemfile.lock +223 -67
- data/omnibus/config/projects/push-jobs-client.rb +7 -16
- data/omnibus/config/software/opscode-pushy-client.rb +8 -7
- data/omnibus/resources/push-jobs-client/msi/source.wxs.erb +5 -2
- data/omnibus_overrides.rb +26 -0
- data/opscode-pushy-client.gemspec +2 -2
- data/pkg/opscode-pushy-client-2.4.11.gem +0 -0
- data/spec/pushy_client/job_runner_spec.rb +100 -0
- metadata +13 -8
- data/pkg/opscode-pushy-client-2.3.0.gem +0 -0
@@ -26,8 +26,12 @@ license_file "LICENSE"
|
|
26
26
|
replace "opscode-push-jobs-client"
|
27
27
|
conflict "opscode-push-jobs-client"
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
build_version IO.read(File.expand_path("../../../../VERSION", __FILE__)).strip
|
30
|
+
|
31
|
+
# In order to prevent unecessary cache expiration, version overrides
|
32
|
+
# and build_iteration are kept in <project-root>/omnibus_overrides.rb
|
33
|
+
overrides_path = File.expand_path("../../../../omnibus_overrides.rb", __FILE__)
|
34
|
+
instance_eval(IO.read(overrides_path), overrides_path)
|
31
35
|
|
32
36
|
if windows?
|
33
37
|
# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files"
|
@@ -38,19 +42,6 @@ else
|
|
38
42
|
install_dir "#{default_root}/#{name}"
|
39
43
|
end
|
40
44
|
|
41
|
-
# TODO: Support chef/ohai master (13)
|
42
|
-
override :chef, version: "v12.19.36" # pin to latest pre-13
|
43
|
-
override :ohai, version: "v8.23.0" # pin to latest pre-13
|
44
|
-
|
45
|
-
override :bundler, version: "1.12.5"
|
46
|
-
override :rubygems, version: "2.6.10"
|
47
|
-
override :ruby, version: "2.3.3"
|
48
|
-
|
49
|
-
# Share pins with ChefDK
|
50
|
-
override :libzmq, version: "4.0.5"
|
51
|
-
|
52
|
-
######
|
53
|
-
|
54
45
|
dependency "preparation"
|
55
46
|
dependency "rb-readline"
|
56
47
|
dependency "opscode-pushy-client"
|
@@ -71,7 +62,7 @@ package :msi do
|
|
71
62
|
fast_msi true
|
72
63
|
# Upgrade code for Chef MSI
|
73
64
|
upgrade_code "D607A85C-BDFA-4F08-83ED-2ECB4DCD6BC5"
|
74
|
-
signing_identity "
|
65
|
+
signing_identity "E05FF095D07F233B78EB322132BFF0F035E11B5B", machine_store: true
|
75
66
|
|
76
67
|
parameters(
|
77
68
|
ProjectLocationDir: 'push-jobs-client',
|
@@ -50,21 +50,22 @@ dependency "libxml2"
|
|
50
50
|
dependency "libxslt"
|
51
51
|
dependency "libiconv"
|
52
52
|
dependency "liblzma"
|
53
|
-
dependency "
|
53
|
+
dependency "libzmq"
|
54
54
|
|
55
55
|
# Core Requirements
|
56
|
+
|
57
|
+
# Instead of trying to get all of FFI working on AIX we decided to build a custom C extension for the parts of
|
58
|
+
# ZeroMQ that we need. We forked an old C native extension of LibZMQ, https://github.com/chef/rbzmq, and modified
|
59
|
+
# it to fit our needs. This meant ripping out any unused code and updating only the methods we need
|
60
|
+
# (like context.socket) to support later versions of Ruby and LibZMQ.
|
61
|
+
dependency "rbzmq" if aix?
|
62
|
+
|
56
63
|
dependency "rubygems"
|
57
64
|
dependency "bundler"
|
58
65
|
dependency "appbundler"
|
59
66
|
dependency "chef"
|
60
67
|
dependency "openssl-customization"
|
61
68
|
|
62
|
-
if windows?
|
63
|
-
dependency "libzmq4x-windows"
|
64
|
-
else
|
65
|
-
dependency "libzmq"
|
66
|
-
end
|
67
|
-
|
68
69
|
build do
|
69
70
|
env = with_standard_compiler_flags(with_embedded_path)
|
70
71
|
|
@@ -91,8 +91,11 @@
|
|
91
91
|
Arguments="[PROJECTLOCATION]$(var.PushJobsGemPath)\lib\pushy_client\windows_service.rb"
|
92
92
|
DisplayName="!(loc.ServiceDisplayName)"
|
93
93
|
Description="!(loc.ServiceDescription)" />
|
94
|
-
<ServiceControl Id="ControlPushJobsClientService"
|
95
|
-
|
94
|
+
<ServiceControl Id="ControlPushJobsClientService"
|
95
|
+
Name="push-jobs-client"
|
96
|
+
Remove="both"
|
97
|
+
Stop="both"
|
98
|
+
Wait="no" />
|
96
99
|
</Component>
|
97
100
|
</Directory>
|
98
101
|
</Directory>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
build_iteration 1
|
2
|
+
|
3
|
+
# Using pins that agree with chef 13.0.118.
|
4
|
+
override :chef, version: "v13.4.24"
|
5
|
+
override :ohai, version: "v13.0.1"
|
6
|
+
|
7
|
+
# Need modern bundler if we wish to support x-plat Gemfile.lock.
|
8
|
+
# Unfortunately, 1.14.x series has issues with BUNDLER_VERSION variables exported by
|
9
|
+
# the omnibus cookbook. Bump to it after the builders no longer set that environment
|
10
|
+
# variable.
|
11
|
+
override :bundler, version: "1.15.4"
|
12
|
+
override :rubygems, version: "2.7.6"
|
13
|
+
override :ruby, version: "2.4.4"
|
14
|
+
|
15
|
+
override "libxml2", version: "2.9.7"
|
16
|
+
# Default in omnibus-software was too old. Feel free to move this ahead as necessary.
|
17
|
+
override :libsodium, version: "1.0.12"
|
18
|
+
if aix?
|
19
|
+
# To get LibZMQ building on AIX we needed to update to 4.2.2 because it has autotools and
|
20
|
+
# build configuration improvements.
|
21
|
+
override :libzmq, version: "4.2.2"
|
22
|
+
else
|
23
|
+
# Pick last version in 4.0.x that we have tested on windows.
|
24
|
+
# Feel free to bump this if you're willing to test out a newer version.
|
25
|
+
override :libzmq, version: "4.0.7"
|
26
|
+
end
|
@@ -17,8 +17,8 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.required_ruby_version = '>= 2.2'
|
19
19
|
|
20
|
-
gem.add_dependency "chef", ">= 12.19", "<
|
21
|
-
gem.add_dependency "ohai", ">= 8.23", "<
|
20
|
+
gem.add_dependency "chef", ">= 12.19", "< 15.0"
|
21
|
+
gem.add_dependency "ohai", ">= 8.23", "< 15.0"
|
22
22
|
gem.add_dependency "ffi-rzmq"
|
23
23
|
gem.add_dependency "uuidtools"
|
24
24
|
|
Binary file
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "chef/log"
|
3
|
+
require "pushy_client/job_runner"
|
4
|
+
|
5
|
+
describe PushyClient::JobRunner do
|
6
|
+
describe "#start_process" do
|
7
|
+
let(:client) { double("client") }
|
8
|
+
let(:shellout) { double("shellout") }
|
9
|
+
let(:job_runner) { described_class.new(client) }
|
10
|
+
let(:whitelist) do
|
11
|
+
{
|
12
|
+
command => command
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:opts) do
|
17
|
+
{
|
18
|
+
'user' => 'user',
|
19
|
+
'dir' => 'dir',
|
20
|
+
'env' => {}
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
let(:node_name) { 'node-name' }
|
25
|
+
let(:command) { 'command' }
|
26
|
+
let(:job_id) { 'id' }
|
27
|
+
|
28
|
+
let(:default_hash) do
|
29
|
+
{
|
30
|
+
'CHEF_PUSH_NODE_NAME' => node_name,
|
31
|
+
'CHEF_PUSH_JOB_ID' => job_id
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
subject(:start_process) do
|
36
|
+
job_runner.instance_variable_set(:@opts, opts)
|
37
|
+
job_runner.instance_variable_set(:@command, command)
|
38
|
+
job_runner.instance_variable_set(:@job_id, job_id)
|
39
|
+
job_runner.send(:start_process)
|
40
|
+
end
|
41
|
+
|
42
|
+
before :each do
|
43
|
+
allow(client).to receive(:node_name).and_return(node_name)
|
44
|
+
allow(client).to receive(:allowed_overwritable_env_vars)
|
45
|
+
allow(client).to receive(:whitelist).and_return(whitelist)
|
46
|
+
allow(Mixlib::ShellOut).to receive(:new).and_return(shellout)
|
47
|
+
end
|
48
|
+
|
49
|
+
context "When allowed_overwriteable_env_vars is nil" do
|
50
|
+
it "has only the default env variables if no others are specified" do
|
51
|
+
expect(Mixlib::ShellOut).to receive(:new).with(command, hash_including(
|
52
|
+
:env=>default_hash)).and_return(shellout)
|
53
|
+
start_process
|
54
|
+
end
|
55
|
+
|
56
|
+
it "uses the passed env vars" do
|
57
|
+
hash = {"foo" => "bar"}
|
58
|
+
hash_expected = default_hash.merge(hash)
|
59
|
+
opts['env'] = hash
|
60
|
+
|
61
|
+
expect(Mixlib::ShellOut).to receive(:new).with(command, hash_including(
|
62
|
+
:env=>hash_expected)).and_return(shellout)
|
63
|
+
start_process
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context "When allowed_overwriteable_env_vars is not nil" do
|
68
|
+
before do
|
69
|
+
allow(client).to receive(:allowed_overwritable_env_vars).and_return(['foo'])
|
70
|
+
end
|
71
|
+
|
72
|
+
it "only returns the default env variables if no others are specified" do
|
73
|
+
expect(Mixlib::ShellOut).to receive(:new).with(command, hash_including(
|
74
|
+
:env=>hash_including(default_hash))).and_return(shellout)
|
75
|
+
start_process
|
76
|
+
end
|
77
|
+
|
78
|
+
it "uses the passed env vars when it's in the allowed list" do
|
79
|
+
hash = {"foo" => "bar"}
|
80
|
+
hash_expected = default_hash.merge(hash)
|
81
|
+
opts['env'] = hash
|
82
|
+
|
83
|
+
expect(Mixlib::ShellOut).to receive(:new).with(command, hash_including(
|
84
|
+
:env=>hash_expected)).and_return(shellout)
|
85
|
+
start_process
|
86
|
+
end
|
87
|
+
|
88
|
+
it "munges the passed env vars when it's not in the allowed list" do
|
89
|
+
hash = {"bar" => "bar"}
|
90
|
+
hash_expected = default_hash.merge("CHEF_PUSH_ENV_bar" => "bar")
|
91
|
+
opts['env'] = hash
|
92
|
+
|
93
|
+
expect(Mixlib::ShellOut).to receive(:new).with(command, hash_including(
|
94
|
+
:env=>hash_expected)).and_return(shellout)
|
95
|
+
start_process
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opscode-pushy-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '12.19'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '15.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '12.19'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '15.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: ohai
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '8.23'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '15.0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '8.23'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '15.0'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: ffi-rzmq
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,8 +150,10 @@ files:
|
|
150
150
|
- Gemfile.lock
|
151
151
|
- LICENSE
|
152
152
|
- README.md
|
153
|
+
- RELEASE_NOTES.md
|
153
154
|
- RELEASE_PROCESS.md
|
154
155
|
- Rakefile
|
156
|
+
- VERSION
|
155
157
|
- bin/print_execution_environment
|
156
158
|
- bin/push-apply
|
157
159
|
- bin/pushy-client
|
@@ -201,8 +203,10 @@ files:
|
|
201
203
|
- omnibus/resources/push-jobs-client/pkg/background.png
|
202
204
|
- omnibus/resources/push-jobs-client/pkg/license.html.erb
|
203
205
|
- omnibus/resources/push-jobs-client/pkg/welcome.html.erb
|
206
|
+
- omnibus_overrides.rb
|
204
207
|
- opscode-pushy-client.gemspec
|
205
|
-
- pkg/opscode-pushy-client-2.
|
208
|
+
- pkg/opscode-pushy-client-2.4.11.gem
|
209
|
+
- spec/pushy_client/job_runner_spec.rb
|
206
210
|
- spec/pushy_client/protocol_handler_spec.rb
|
207
211
|
- spec/pushy_client/whitelist_spec.rb
|
208
212
|
- spec/spec_helper.rb
|
@@ -225,11 +229,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
229
|
version: '0'
|
226
230
|
requirements: []
|
227
231
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.6
|
232
|
+
rubygems_version: 2.7.6
|
229
233
|
signing_key:
|
230
234
|
specification_version: 4
|
231
235
|
summary: Client for Chef push jobs server
|
232
236
|
test_files:
|
237
|
+
- spec/pushy_client/job_runner_spec.rb
|
233
238
|
- spec/pushy_client/protocol_handler_spec.rb
|
234
239
|
- spec/pushy_client/whitelist_spec.rb
|
235
240
|
- spec/spec_helper.rb
|
Binary file
|