deplomat 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 63793edf4cb9a8171fcd79e69826ee39e5659db2
4
- data.tar.gz: 3b57e5f56f8fedb0ebd3955f7290de0f9ff06631
2
+ SHA256:
3
+ metadata.gz: dbe01ba773bbcd64d26dcde79e074984816494d0111840223e5c19cef8dd8dc8
4
+ data.tar.gz: f93e3b3beaa99612c9fc6eac272b00b00017383905197cfaee7121e868473082
5
5
  SHA512:
6
- metadata.gz: d7339345739a63555611385e8562f13a67468430507ec0ab9eb64326c830dd01b5de67105a47603c2c414645b362f4d465307f206803fbee220f59f23a05a7ed
7
- data.tar.gz: b182de477fd7236858c80d3bc08e5b2f398e2ea6fd7f071f310b82cb07264c839d1f41c5d01f8591d2ba1469fb6ddf0bb9a12469a24fd52f98421cc94314929d
6
+ metadata.gz: e188aaa8a668b33d377951ffaf8c539f7fdadd08f3e35429013ac3c38a637723d675b33e0be52d44df38b6c0b10ee8ee513554d3842afba459aaae8c330bd284
7
+ data.tar.gz: 328e5d6bd8f29dbed2f195cb67e1f90a2d22d5fba6b3f725bdc6866618d943ed16334386eb8ff7c186e3ce64845511d067c0e91f52168ae285ab1b521ecb6834
data/Gemfile.lock CHANGED
@@ -3,13 +3,14 @@ GEM
3
3
  specs:
4
4
  addressable (2.4.0)
5
5
  builder (3.2.3)
6
- colorize (0.7.7)
6
+ colorize (0.8.1)
7
7
  descendants_tracker (0.0.4)
8
8
  thread_safe (~> 0.3, >= 0.3.1)
9
- diff-lcs (1.2.5)
9
+ diff-lcs (1.3)
10
10
  faraday (0.9.2)
11
11
  multipart-post (>= 1.2, < 3)
12
- git (1.3.0)
12
+ ffi (1.9.25)
13
+ git (1.4.0)
13
14
  github_api (0.16.0)
14
15
  addressable (~> 2.4.0)
15
16
  descendants_tracker (~> 0.0.4)
@@ -17,26 +18,26 @@ GEM
17
18
  hashie (>= 3.4)
18
19
  mime-types (>= 1.16, < 3.0)
19
20
  oauth2 (~> 1.0)
20
- hashie (3.5.6)
21
- highline (1.7.8)
22
- jeweler (2.3.7)
21
+ hashie (3.5.7)
22
+ highline (1.7.10)
23
+ jeweler (2.3.9)
23
24
  builder
24
- bundler (>= 1)
25
+ bundler
25
26
  git (>= 1.2.5)
26
27
  github_api (~> 0.16.0)
27
28
  highline (>= 1.6.15)
28
29
  nokogiri (>= 1.5.10)
29
- psych (~> 2.2)
30
+ psych
30
31
  rake
31
32
  rdoc
32
33
  semver2
33
34
  jwt (1.5.6)
34
35
  mime-types (2.99.3)
35
36
  mini_portile2 (2.3.0)
36
- multi_json (1.12.2)
37
+ multi_json (1.13.1)
37
38
  multi_xml (0.6.0)
38
39
  multipart-post (2.0.0)
39
- nokogiri (1.8.1)
40
+ nokogiri (1.8.2)
40
41
  mini_portile2 (~> 2.3.0)
41
42
  oauth2 (1.4.0)
42
43
  faraday (>= 0.8, < 0.13)
@@ -44,25 +45,26 @@ GEM
44
45
  multi_json (~> 1.3)
45
46
  multi_xml (~> 0.5)
46
47
  rack (>= 1.2, < 3)
47
- psych (2.2.4)
48
- rack (2.0.3)
49
- rake (12.3.0)
50
- rdoc (5.1.0)
51
- rspec (3.4.0)
52
- rspec-core (~> 3.4.0)
53
- rspec-expectations (~> 3.4.0)
54
- rspec-mocks (~> 3.4.0)
55
- rspec-core (3.4.4)
56
- rspec-support (~> 3.4.0)
57
- rspec-expectations (3.4.0)
48
+ psych (3.0.2)
49
+ rack (2.0.5)
50
+ rake (12.3.1)
51
+ rdoc (6.0.4)
52
+ rspec (3.7.0)
53
+ rspec-core (~> 3.7.0)
54
+ rspec-expectations (~> 3.7.0)
55
+ rspec-mocks (~> 3.7.0)
56
+ rspec-core (3.7.1)
57
+ rspec-support (~> 3.7.0)
58
+ rspec-expectations (3.7.0)
58
59
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.4.0)
60
- rspec-mocks (3.4.1)
60
+ rspec-support (~> 3.7.0)
61
+ rspec-mocks (3.7.0)
61
62
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.4.0)
63
- rspec-support (3.4.1)
63
+ rspec-support (~> 3.7.0)
64
+ rspec-support (3.7.1)
64
65
  semver2 (3.4.2)
65
- sys-proctable (1.0.0)
66
+ sys-proctable (1.2.0)
67
+ ffi
66
68
  thread_safe (0.3.6)
67
69
 
68
70
  PLATFORMS
@@ -76,4 +78,4 @@ DEPENDENCIES
76
78
  sys-proctable
77
79
 
78
80
  BUNDLED WITH
79
- 1.16.0
81
+ 1.16.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -14,13 +14,18 @@ module Deplomat
14
14
  system first_ssh_command
15
15
 
16
16
  # get background process id by the full command name
17
+ @pids = []
17
18
  Sys::ProcTable.ps.each do |process|
18
19
  if process.cmdline.match(first_ssh_command)
19
- @pid = process.pid.to_i
20
- puts "Connected with ssh, host #{host}, pid #{@pid}."
21
- break
20
+ @pids << process.pid.to_i
22
21
  end
23
22
  end
23
+ if @pids.length > 1
24
+ puts "Connected with ssh, host #{host}, but looks like another connection has been opened before..."
25
+ puts "connection pids: #{@pids.join(", ")}. We'll be closing them all when finished."
26
+ else
27
+ puts "Connected with ssh, host #{host}, pid #{@pids.first}"
28
+ end
24
29
 
25
30
  @ssh_command = "ssh -S #{ENV['HOME']}/.ssh/controlmasters/%r@%h:%p #{user}@#{host} -p #{port}"
26
31
 
@@ -45,8 +50,8 @@ module Deplomat
45
50
 
46
51
  def close
47
52
  begin
48
- puts "Closing connection to #{@host}."
49
- Process.kill 'KILL', @pid
53
+ puts "Closing connection(s) to #{@host}, ssh pid(s): #{@pids.join(", ")}."
54
+ @pids.each { |pid| Process.kill 'KILL', pid }
50
55
  rescue Errno::ESRCH
51
56
  puts "WARNING: no process with #{@pid} found, no connection to close!"
52
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-19 00:00:00.000000000 Z
11
+ date: 2018-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sys-proctable
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.5.1
138
+ rubygems_version: 2.7.6
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Stack agnostic deployment system that uses bash and ssh commands