shelly 0.4.29.pre → 0.4.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +3 -1
- data/lib/shelly/app.rb +14 -2
- data/lib/shelly/version.rb +1 -1
- data/shelly.gemspec +1 -0
- data/spec/shelly/app_spec.rb +8 -8
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWNiN2MyNmY4ZGU5NDU4YWY0YzM5YTUzNGNmZWRkMjI5MDBjODU5NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWI4ZDNmNGI0ZWE2NmFkNDQzN2YzMDY3YjQ2ODczYzkzNmMzNGVlZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTRkNGNhZGJjMmFhMzM4MDBlYzY4ZWIzMWM1YTg0MDk2YWQ4ZmQyNTNjZGEx
|
10
|
+
Mjc4MWRhMTRjN2I1ZGQ4OGY0YjVkODFmYjU4ZGY0Mjk2NDkxNjljNjhmZjQ2
|
11
|
+
NjE2YTgzMTI1ZWJkYjEzZmJkNGE1MTEyOTU2YzgzY2IzZmIxZGE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2ZkODAzMjBkZmMxOWUxNmE0NjQzM2IyY2QwZmVkMmIyYWYwMmU1ZTEwZTFk
|
14
|
+
OTQyODE4ZjZkYWJhY2QyMmNkM2ZhYzI0NzAyYTg4ZTUwZmQ5ZjFlNDJiYjgx
|
15
|
+
YTI0ZTZkY2Q3ZGJlOTMxMDM4MjZlNWFiMTU2ZTg1ZWZkZTAyNjQ=
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
##
|
1
|
+
## 0.4.29 / 2014-03-27
|
2
2
|
|
3
|
+
* [bugfix] Use childprocess to start ssh related commands. Fixes tty issue
|
4
|
+
when using `shelly console` on JRuby
|
3
5
|
* [bugfix] Capture password without echo only if terminal is present
|
4
6
|
* [feature] Support for `shelly ssh` command
|
5
7
|
|
data/lib/shelly/app.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
require 'erb'
|
2
2
|
require 'launchy'
|
3
|
+
require 'childprocess'
|
4
|
+
require 'shellwords'
|
3
5
|
require 'shelly/backup'
|
4
6
|
|
5
7
|
module Shelly
|
6
8
|
class App < Model
|
9
|
+
include ::Shellwords
|
10
|
+
|
7
11
|
DATABASE_KINDS = %w(postgresql mongodb redis)
|
8
12
|
DATABASE_CHOICES = DATABASE_KINDS + %w(none)
|
9
13
|
SERVER_SIZES = %w(small large)
|
@@ -448,12 +452,12 @@ module Shelly
|
|
448
452
|
|
449
453
|
def ssh(options = {})
|
450
454
|
conn = tunnel_connection("ssh", options[:server])
|
451
|
-
|
455
|
+
childprocess("ssh #{ssh_options(conn)} -t -t #{conn['host']} #{options[:command]}")
|
452
456
|
end
|
453
457
|
|
454
458
|
def ssh_with_db_server(options = {})
|
455
459
|
conn = configured_db_server_connection(options[:server])
|
456
|
-
|
460
|
+
childprocess("ssh #{ssh_options(conn)} -t -t #{conn['host']} #{options[:command]}")
|
457
461
|
end
|
458
462
|
|
459
463
|
def ssh_options(conn)
|
@@ -463,5 +467,13 @@ module Shelly
|
|
463
467
|
def rsync(source, destination, conn, options = "")
|
464
468
|
system "rsync --archive --verbose --compress #{options} -e 'ssh #{ssh_options(conn)}' --progress #{source} #{destination}"
|
465
469
|
end
|
470
|
+
|
471
|
+
def childprocess(command)
|
472
|
+
ChildProcess.posix_spawn = true
|
473
|
+
process = ::ChildProcess.build(*shellwords(command))
|
474
|
+
process.io.inherit!
|
475
|
+
process.start
|
476
|
+
process.wait
|
477
|
+
end
|
466
478
|
end
|
467
479
|
end
|
data/lib/shelly/version.rb
CHANGED
data/shelly.gemspec
CHANGED
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.add_runtime_dependency "progressbar"
|
31
31
|
s.add_runtime_dependency "launchy"
|
32
32
|
s.add_runtime_dependency "netrc"
|
33
|
+
s.add_runtime_dependency "childprocess"
|
33
34
|
|
34
35
|
s.files = `git ls-files`.split("\n")
|
35
36
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/spec/shelly/app_spec.rb
CHANGED
@@ -420,7 +420,7 @@ describe Shelly::App do
|
|
420
420
|
it "should return result of rake task" do
|
421
421
|
@client.stub(:tunnel).and_return(
|
422
422
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
423
|
-
@app.should_receive(:
|
423
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com rake_runner \"test\"")
|
424
424
|
@app.rake("test")
|
425
425
|
end
|
426
426
|
end
|
@@ -429,7 +429,7 @@ describe Shelly::App do
|
|
429
429
|
it "should return result of dbconsole" do
|
430
430
|
@client.stub(:configured_db_server).and_return(
|
431
431
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
432
|
-
@app.should_receive(:
|
432
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com start_dbconsole")
|
433
433
|
@app.dbconsole
|
434
434
|
end
|
435
435
|
end
|
@@ -438,7 +438,7 @@ describe Shelly::App do
|
|
438
438
|
it "should return result of mongoconsole" do
|
439
439
|
@client.stub(:configured_db_server).and_return(
|
440
440
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
441
|
-
@app.should_receive(:
|
441
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com start_mongodb")
|
442
442
|
@app.mongoconsole
|
443
443
|
end
|
444
444
|
end
|
@@ -447,7 +447,7 @@ describe Shelly::App do
|
|
447
447
|
it "should return result of redis-cli" do
|
448
448
|
@client.stub(:configured_db_server).and_return(
|
449
449
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
450
|
-
@app.should_receive(:
|
450
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com start_redis")
|
451
451
|
@app.redis_cli
|
452
452
|
end
|
453
453
|
end
|
@@ -478,14 +478,14 @@ describe Shelly::App do
|
|
478
478
|
it "should run ssh with all parameters" do
|
479
479
|
@client.stub(:tunnel).and_return(
|
480
480
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
481
|
-
@app.should_receive(:
|
481
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com ")
|
482
482
|
@app.ssh_console
|
483
483
|
end
|
484
484
|
|
485
485
|
context "when server passed" do
|
486
486
|
it "should request console on given server" do
|
487
487
|
@client.should_receive(:tunnel).with("foo-staging", "ssh", "app1").and_return({})
|
488
|
-
@app.
|
488
|
+
@app.should_receive(:childprocess)
|
489
489
|
@app.console("app1")
|
490
490
|
end
|
491
491
|
end
|
@@ -495,14 +495,14 @@ describe Shelly::App do
|
|
495
495
|
it "should run ssh with all parameters" do
|
496
496
|
@client.stub(:tunnel).and_return(
|
497
497
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
498
|
-
@app.should_receive(:
|
498
|
+
@app.should_receive(:childprocess).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com start_console")
|
499
499
|
@app.console
|
500
500
|
end
|
501
501
|
|
502
502
|
context "when server passed" do
|
503
503
|
it "should request console on given server" do
|
504
504
|
@client.should_receive(:tunnel).with("foo-staging", "ssh", "app1").and_return({})
|
505
|
-
@app.
|
505
|
+
@app.should_receive(:childprocess)
|
506
506
|
@app.console("app1")
|
507
507
|
end
|
508
508
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.29
|
4
|
+
version: 0.4.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shelly Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -220,6 +220,20 @@ dependencies:
|
|
220
220
|
- - ! '>='
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: childprocess
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ! '>='
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ! '>='
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
223
237
|
description: Tool for managing applications and clouds at shellycloud.com
|
224
238
|
email:
|
225
239
|
- devs@shellycloud.com
|
@@ -329,9 +343,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
329
343
|
version: '0'
|
330
344
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
345
|
requirements:
|
332
|
-
- - ! '
|
346
|
+
- - ! '>='
|
333
347
|
- !ruby/object:Gem::Version
|
334
|
-
version:
|
348
|
+
version: '0'
|
335
349
|
requirements: []
|
336
350
|
rubyforge_project: shelly
|
337
351
|
rubygems_version: 2.2.2
|