hobo-inviqa 0.0.7.pre.rc2 → 0.0.7.pre.rc3

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTRkZWNjNDIxZGFkODc3MDM2ZmViYTk2OTFkOGM1NTVjMDE0YWU0MA==
4
+ MjQzZmFjY2Y1M2FjNGMyZTgzMWE4YmExMTI1YTliY2NkYzNiMWExYw==
5
5
  data.tar.gz: !binary |-
6
- MWIyZWM0NWNlMDg1YzJiOTI3NzY2ODc5M2ViNDhlNDA3MGNiMmMwYg==
6
+ YWVkNDBkOGJkN2ViYjBmY2Y0ZTE5NjQxYWY2NWI5ZGNjMWQ2MWNmOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDhiM2M3ZmVmNmU2NDYzYTE0M2YxNTc4ZTQ3MjUzODRkMWE4MDJmM2M2ZGFm
10
- YWJjYmU3M2Q4MWVjMThiNTA1ZjhjMTZlNzVmZDlkY2UyMzExYmE0ZWE4NDA1
11
- NDA2MjAzNmJhYzYwZDU4MDM2Y2I5ZjllOTE2MWVkYWY2MWNkMTc=
9
+ NjU2ZWQ2ZWU3ODAwMWFlMmMwYmZkYjFlZjgwYzdiOGMzYmI3NzM3MWQ0Yzc4
10
+ YzNjMjk3NWYyNTQwY2JkYTZlNTI0NzNlODdhOTcwOTA2ODQ1ZDU4ZGI1YWZk
11
+ ZjZjYjgyMzBiYjE4YWM1ZWY4ZjgwNzQ3MzVjMTlmZDQxYmZmYzY=
12
12
  data.tar.gz: !binary |-
13
- NDIzYzNhOTgwYzM2MjYyMGE2ZWQyZmJjYzA2NjFiYzNlMWQ5NGMxZWU4Mjdm
14
- NDUyOTRkNjY2ZWEzOGJhNzU0YjI3NmM1ZmM2NzkzZTU0OWFmNDEzMjJhN2Fm
15
- Y2NjOTRhMjhjYjQyN2M0N2Q3YmY2MjJhOGEyOGUyZWM2NDUwNmM=
13
+ MGE4MTNlMDI0NTQ1MzdlNTU3M2QxMjk1MzgzZThiNGYyMDQ4MGJlZjc3YmZl
14
+ ODJjMDhlNjUyMGNlZmY1NjE2YjgwNTM1NmY5NWJiZTY1ZWE0MWFmZjYzYWMw
15
+ MTE3MTBiNGRiMDk3MjA5ODBhMTNlOTBlNDU2YmY4YzkxOWY2ODY=
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hobo-inviqa (0.0.7.pre.rc2)
4
+ hobo-inviqa (0.0.7.pre.rc3)
5
5
  aws-sdk (~> 1.34.0)
6
6
  bundler (~> 1.5.2)
7
7
  deepstruct (~> 0.0.5)
8
8
  highline (~> 1.6.20)
9
+ net-ssh-simple (~> 1.6.3)
9
10
  os (~> 0.9.6)
10
11
  rake (~> 10.1.1)
11
12
  rake-hooks (~> 1.2.3)
@@ -25,6 +26,7 @@ GEM
25
26
  json (~> 1.4)
26
27
  nokogiri (>= 1.4.4)
27
28
  uuidtools (~> 2.1)
29
+ blockenspiel (0.4.5)
28
30
  builder (3.2.2)
29
31
  celluloid (0.15.2)
30
32
  timers (~> 1.1.0)
@@ -59,6 +61,7 @@ GEM
59
61
  guard-rspec (4.2.6)
60
62
  guard (~> 2.1)
61
63
  rspec (>= 2.14, < 4.0)
64
+ hashie (2.0.5)
62
65
  highline (1.6.21)
63
66
  json (1.8.1)
64
67
  listen (2.5.0)
@@ -71,6 +74,14 @@ GEM
71
74
  mini_portile (0.5.2)
72
75
  multi_json (1.8.4)
73
76
  multi_test (0.0.3)
77
+ net-scp (1.1.2)
78
+ net-ssh (>= 2.6.5)
79
+ net-ssh (2.7.0)
80
+ net-ssh-simple (1.6.3)
81
+ blockenspiel (~> 0.4.3)
82
+ hashie (>= 1.1.0)
83
+ net-scp (~> 1.1.0)
84
+ net-ssh (~> 2.7.0)
74
85
  nio4r (1.0.0)
75
86
  nokogiri (1.6.1)
76
87
  mini_portile (~> 0.5.0)
@@ -94,7 +105,7 @@ GEM
94
105
  rspec-expectations (2.14.5)
95
106
  diff-lcs (>= 1.1.3, < 2.0)
96
107
  rspec-mocks (2.14.5)
97
- ruby-progressbar (1.4.1)
108
+ ruby-progressbar (1.4.2)
98
109
  semantic (1.3.0)
99
110
  slop (3.4.7)
100
111
  teerb (0.0.1)
data/hobo.gemspec CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "ruby-progressbar", "~> 1.4.1"
30
30
  spec.add_dependency "teerb", "~> 0.0.1"
31
31
  spec.add_dependency "os", "~> 0.9.6"
32
+ spec.add_dependency "net-ssh-simple", "~> 1.6.3"
32
33
 
33
34
  spec.add_development_dependency "aruba", "~> 0.5.4"
34
35
  spec.add_development_dependency "rspec", "~> 2.14.1"
@@ -1,4 +1,5 @@
1
1
  require 'tempfile'
2
+ require 'net/ssh/simple'
2
3
 
3
4
  module Hobo
4
5
  module Helper
@@ -37,29 +38,29 @@ module Hobo
37
38
  return @project_mount_path if @project_mount_path
38
39
 
39
40
  tmp = Tempfile.new('vm_command_locator', Hobo.project_path)
40
- tmp.write(Hobo.project_path)
41
41
 
42
- locator_file = File.basename(tmp.path)
42
+ begin
43
+ tmp.write(Hobo.project_path)
43
44
 
44
- pattern = OS.windows? ? 'vboxsf' : Hobo.project_path.shellescape
45
+ locator_file = File.basename(tmp.path)
45
46
 
46
- # TODO genericise the command escaping from lib/hobo/patches/slop.rb to avoid nested shell escaping hell
47
- sed = 's/.* on \(.*\) type.*/\\\1\\\/%%/g'.gsub('%%', locator_file)
48
- locator_results = vm_shell(
49
- "mount | grep #{pattern} | sed -e\"#{sed}\" | xargs md5sum",
50
- :capture => true,
51
- :pwd => '/',
52
- :psuedo_tty => false,
53
- :ignore_errors => true
54
- )
47
+ pattern = OS.windows? ? 'vboxsf' : Hobo.project_path.shellescape
55
48
 
56
- tmp.close
49
+ sed = 's/.* on \(.*\) type.*/\1\/%%/g'.gsub('%%', locator_file)
50
+ locator_results = VmCommand.new(
51
+ "mount | grep #{pattern} | sed -e\"#{sed}\" | xargs md5sum",
52
+ :capture => true,
53
+ :pwd => '/'
54
+ ).run
55
+ ensure
56
+ tmp.unlink
57
+ end
57
58
 
58
59
  match = locator_results.match(/^([a-z0-9]{32})\s+(.*)$/)
59
60
 
60
61
  raise Exception.new("Unable to locate project mount point in VM") if !match
61
62
 
62
- @project_mount_path = File.dirname(match[2])
63
+ @vm_project_mount_path = File.dirname(match[2])
63
64
 
64
65
  # Stash it in config
65
66
  Hobo.project_config[:vm] ||= {}
@@ -128,6 +129,45 @@ module Hobo
128
129
  return self
129
130
  end
130
131
 
132
+ # TODO Refactor in to ssh helper with similar opts to shell helper
133
+ # TODO Migrate all vm_shell functionality this direction
134
+ def run
135
+ return if @command.nil?
136
+ opts = @@vm_inspector.ssh_config.merge(@opts)
137
+
138
+ Net::SSH::Simple.sync do
139
+ ssh_opts = {
140
+ :user => opts[:ssh_user],
141
+ :port => opts[:ssh_port],
142
+ :forward_agent => true,
143
+ :global_known_hosts_file => "/dev/null",
144
+ :paranoid => false,
145
+ :user_known_hosts_file => "/dev/null"
146
+ }
147
+
148
+ ssh_opts[:keys] = [opts[:ssh_identity]] if opts[:ssh_identity]
149
+
150
+ tmp = Tempfile.new "vm_command_exec"
151
+
152
+ begin
153
+ filename = File.basename(tmp.path)
154
+ remote_file = "/tmp/#{filename}"
155
+ tmp.write "#{@command}#{opts[:append]}"
156
+ tmp.close
157
+
158
+ scp_put opts[:ssh_host], tmp.path, remote_file, ssh_opts
159
+ result = ssh opts[:ssh_host], "cd #{opts[:pwd]}; exec /bin/bash #{remote_file}", ssh_opts
160
+ ssh opts[:ssh_host], "rm #{remote_file}", ssh_opts
161
+
162
+ # Throw exception if exit code not 0
163
+
164
+ return opts[:capture] ? result.stdout : result.success
165
+ ensure
166
+ tmp.unlink
167
+ end
168
+ end
169
+ end
170
+
131
171
  # TODO Speed up Vagrant SSH connections
132
172
  # May need to be disabled for windows (mm_send_fd: UsePrivilegeSeparation=yes not supported)
133
173
  # https://gist.github.com/jedi4ever/5657094
@@ -70,13 +70,22 @@ namespace :deps do
70
70
  desc "Install chef dependencies"
71
71
  task :chef => [ "deps:gems" ] do
72
72
  locate "*Cheffile" do
73
- Hobo.ui.title "Installing chef dependencies"
73
+ Hobo.ui.title "Installing chef dependencies via librarian"
74
74
  Bundler.with_clean_env do
75
- bundle_shell "librarian-chef", "install", "--verbose", realtime: true, indent: 2 do |line|
75
+ bundle_shell "librarian-chef", "install", "--verbose", :realtime => true, :indent => 2 do |line|
76
76
  line =~ /Installing.*</ ? line.strip + "\n" : nil
77
77
  end
78
78
  end
79
79
  Hobo.ui.separator
80
80
  end
81
+
82
+ locate "*Berksfile" do
83
+ Hobo.ui.title "Installing chef dependencies via berkshelf"
84
+ Bundler.with_clean_env do
85
+ bundle_shell "berks", "install", :realtime => true, :indent => 2
86
+ bundle_shell "berks", "install", "--path", "cookbooks"
87
+ end
88
+ Hobo.ui.separator
89
+ end
81
90
  end
82
91
  end
data/lib/hobo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hobo
2
- VERSION = '0.0.7-rc2'
2
+ VERSION = '0.0.7-rc3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo-inviqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7.pre.rc2
4
+ version: 0.0.7.pre.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Simons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-03 00:00:00.000000000 Z
11
+ date: 2014-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.9.6
167
+ - !ruby/object:Gem::Dependency
168
+ name: net-ssh-simple
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ~>
172
+ - !ruby/object:Gem::Version
173
+ version: 1.6.3
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ~>
179
+ - !ruby/object:Gem::Version
180
+ version: 1.6.3
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: aruba
169
183
  requirement: !ruby/object:Gem::Requirement