shelly 0.4.28.pre2 → 0.4.28
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 +8 -8
- data/CHANGELOG.md +0 -4
- data/lib/shelly/app.rb +4 -8
- data/lib/shelly/cli/main.rb +1 -15
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/app_spec.rb +4 -21
- data/spec/shelly/cli/main_spec.rb +0 -38
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWJiYTdjMjc5ZmQyOTc5Y2E5NGZjMThlZTk2MWE3YzRhYzZmNGM0Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGI4MzgwMmU0YjdmMjBlY2ZhYzA3MjA5MmQzZTc0MDUyYjM3ZmQ1NA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGE1OTZiMmJmMzMwZWExMzhjOTIxMDZjY2Y4MjUzNTZlODYyZTQxZmNjNTgx
|
10
|
+
ZDA5NWI5YTAyMWExNDAwNTk5NjRmNzA3MDBkODAxZWEwZTVjNjgzMTVmNjdi
|
11
|
+
ZjQ4MjBjMjkyNzMyZmMwOGJjZTBhZWUzZDg4N2FlYjVjZjJhYjU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2IzNTVlMjgwYTdkNDU4ZTRmOTYwZTQwZmNmZjBkZmE4NTgyZTMxMTcyNjQx
|
14
|
+
MGJlMTc3ZjUxNWU0ZjE5MzkxZmQ3MWM0MzMwYTE1NDFlMTVkYTg4YjdmYzAy
|
15
|
+
YjlhNTA0NTdlMzJiMzUwMTRhZWJiYzA4ZWQ0MDZiOWNiNjZiZGE=
|
data/CHANGELOG.md
CHANGED
data/lib/shelly/app.rb
CHANGED
@@ -216,15 +216,15 @@ module Shelly
|
|
216
216
|
end
|
217
217
|
|
218
218
|
def dbconsole
|
219
|
-
ssh_with_db_server(:command => "
|
219
|
+
ssh_with_db_server(:command => "dbconsole")
|
220
220
|
end
|
221
221
|
|
222
222
|
def mongoconsole
|
223
|
-
ssh_with_db_server(:command => "
|
223
|
+
ssh_with_db_server(:command => "mongo")
|
224
224
|
end
|
225
225
|
|
226
226
|
def redis_cli
|
227
|
-
ssh_with_db_server(:command => "
|
227
|
+
ssh_with_db_server(:command => "redis-cli")
|
228
228
|
end
|
229
229
|
|
230
230
|
def attributes
|
@@ -295,12 +295,8 @@ module Shelly
|
|
295
295
|
Launchy.open("http://#{attributes["domain"]}")
|
296
296
|
end
|
297
297
|
|
298
|
-
def ssh_console(server = nil)
|
299
|
-
ssh(:server => server)
|
300
|
-
end
|
301
|
-
|
302
298
|
def console(server = nil)
|
303
|
-
ssh(:
|
299
|
+
ssh(:server => server)
|
304
300
|
end
|
305
301
|
|
306
302
|
def list_files(path)
|
data/lib/shelly/cli/main.rb
CHANGED
@@ -32,7 +32,7 @@ module Shelly
|
|
32
32
|
# FIXME: it should be possible to pass single symbol, instead of one element array
|
33
33
|
before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop,
|
34
34
|
:delete, :info, :ip, :logout, :execute, :rake, :setup, :console,
|
35
|
-
:dbconsole, :mongoconsole, :redis_cli
|
35
|
+
:dbconsole, :mongoconsole, :redis_cli]
|
36
36
|
before_hook :inside_git_repository?, :only => [:add, :setup, :check]
|
37
37
|
|
38
38
|
map %w(-v --version) => :version
|
@@ -365,20 +365,6 @@ Wait until cloud is in 'turned off' state and try again.}
|
|
365
365
|
say_error "Virtual server '#{options[:server]}' not found or not configured for running console"
|
366
366
|
end
|
367
367
|
|
368
|
-
desc "ssh", "Log into virtual server"
|
369
|
-
method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
|
370
|
-
method_option :server, :type => :string, :aliases => "-s",
|
371
|
-
:desc => "Specify virtual server, it's random by default"
|
372
|
-
def ssh
|
373
|
-
app = multiple_clouds(options[:cloud], "ssh")
|
374
|
-
app.ssh_console(options[:server])
|
375
|
-
rescue Client::ConflictException
|
376
|
-
say_error "Cloud #{app} is not running. Cannot run ssh console."
|
377
|
-
rescue Client::NotFoundException => e
|
378
|
-
raise unless e.resource == :virtual_server
|
379
|
-
say_error "Virtual server '#{options[:server]}' not found or not configured for running ssh console"
|
380
|
-
end
|
381
|
-
|
382
368
|
# FIXME: move to helpers
|
383
369
|
no_tasks do
|
384
370
|
# Returns valid arguments for rake, removes shelly gem arguments
|
data/lib/shelly/version.rb
CHANGED
data/spec/shelly/app_spec.rb
CHANGED
@@ -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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com
|
432
|
+
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com 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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com
|
441
|
+
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com mongo")
|
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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com
|
450
|
+
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com redis-cli")
|
451
451
|
@app.redis_cli
|
452
452
|
end
|
453
453
|
end
|
@@ -474,28 +474,11 @@ describe Shelly::App do
|
|
474
474
|
end
|
475
475
|
end
|
476
476
|
|
477
|
-
describe "#ssh_console" do
|
478
|
-
it "should run ssh with all parameters" do
|
479
|
-
@client.stub(:tunnel).and_return(
|
480
|
-
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
481
|
-
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com ")
|
482
|
-
@app.ssh_console
|
483
|
-
end
|
484
|
-
|
485
|
-
context "when server passed" do
|
486
|
-
it "should request console on given server" do
|
487
|
-
@client.should_receive(:tunnel).with("foo-staging", "ssh", "app1").and_return({})
|
488
|
-
@app.stub(:system)
|
489
|
-
@app.console("app1")
|
490
|
-
end
|
491
|
-
end
|
492
|
-
end
|
493
|
-
|
494
477
|
describe "#console" do
|
495
478
|
it "should run ssh with all parameters" do
|
496
479
|
@client.stub(:tunnel).and_return(
|
497
480
|
{"host" => "console.example.com", "port" => "40010", "user" => "foo"})
|
498
|
-
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com
|
481
|
+
@app.should_receive(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com ")
|
499
482
|
@app.console
|
500
483
|
end
|
501
484
|
|
@@ -51,7 +51,6 @@ describe Shelly::CLI::Main do
|
|
51
51
|
out.should include("shelly organization <command> # View organizations")
|
52
52
|
out.should include("shelly rake TASK # Run rake task")
|
53
53
|
out.should include("shelly redeploy # Redeploy application")
|
54
|
-
out.should include("shelly ssh # Log into virtual server")
|
55
54
|
out.should include("shelly redis-cli # Run redis-cli")
|
56
55
|
out.should include("shelly register [EMAIL] # Register new account")
|
57
56
|
out.should include("shelly setup # Set up git remotes for deployment on Shelly Cloud")
|
@@ -1627,43 +1626,6 @@ Wait until cloud is in 'turned off' state and try again.")
|
|
1627
1626
|
end
|
1628
1627
|
end
|
1629
1628
|
|
1630
|
-
describe "#ssh" do
|
1631
|
-
before do
|
1632
|
-
setup_project
|
1633
|
-
end
|
1634
|
-
|
1635
|
-
it "should ensure user has logged in" do
|
1636
|
-
hooks(@main, :ssh).should include(:logged_in?)
|
1637
|
-
end
|
1638
|
-
|
1639
|
-
it "should execute ssh command" do
|
1640
|
-
@app.should_receive(:ssh_console)
|
1641
|
-
invoke(@main, :ssh)
|
1642
|
-
end
|
1643
|
-
|
1644
|
-
context "virtual servers are not running" do
|
1645
|
-
it "should display error" do
|
1646
|
-
@client.stub(:tunnel).and_raise(Shelly::Client::ConflictException)
|
1647
|
-
$stdout.should_receive(:puts).with(red "Cloud foo-production is not running. Cannot run ssh console.")
|
1648
|
-
lambda {
|
1649
|
-
invoke(@main, :ssh)
|
1650
|
-
}.should raise_error(SystemExit)
|
1651
|
-
end
|
1652
|
-
end
|
1653
|
-
|
1654
|
-
context "virtual server not found" do
|
1655
|
-
it "should display error" do
|
1656
|
-
ex = Shelly::Client::NotFoundException.new("resource" => "virtual_server")
|
1657
|
-
@client.stub(:tunnel).and_raise(ex)
|
1658
|
-
@main.options = {:server => "foobar"}
|
1659
|
-
$stdout.should_receive(:puts).with(red "Virtual server 'foobar' not found or not configured for running ssh console")
|
1660
|
-
lambda {
|
1661
|
-
invoke(@main, :ssh)
|
1662
|
-
}.should raise_error(SystemExit)
|
1663
|
-
end
|
1664
|
-
end
|
1665
|
-
end
|
1666
|
-
|
1667
1629
|
describe "#check" do
|
1668
1630
|
before do
|
1669
1631
|
Shelly::App.stub(:inside_git_repository?).and_return(true)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.28
|
4
|
+
version: 0.4.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shelly Cloud team
|
@@ -329,9 +329,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
329
329
|
version: '0'
|
330
330
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
|
-
- - ! '
|
332
|
+
- - ! '>='
|
333
333
|
- !ruby/object:Gem::Version
|
334
|
-
version:
|
334
|
+
version: '0'
|
335
335
|
requirements: []
|
336
336
|
rubyforge_project: shelly
|
337
337
|
rubygems_version: 2.2.2
|