shelly 0.4.27 → 0.4.28.pre

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 28f1c401ce8ce75157e936a8026688c44348479c
4
- data.tar.gz: e090819c15f52fb5e899a7e2cb42c460d7dbe4f8
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTY0NDI5NTc5ZTU0ODgwNWRjYTllNDJmYjIwN2Q5OWYwNjNhODAxNg==
5
+ data.tar.gz: !binary |-
6
+ MTUwOTMxY2RkZDAwYTI4Y2E5YjhiOWYzZWJkMzkzYmQ4ZDliNWQyNw==
5
7
  SHA512:
6
- metadata.gz: a74b2653e06afbeefc57dddaf8c2424b5600fb51935d7065f7f10903222fd35d5a73b264b77e1d43654c8f525ca85aa45b0d195d8c32570ad15a5475db4143c5
7
- data.tar.gz: bb588554fdcc7bb9e10fe0fd6ec33025d2578f61f874a4d251f00952f72f51a2fbd4d479f8182626711eeda0478e0a83dd0e52f32c3f31e0c0ef8002caf4e67b
8
+ metadata.gz: !binary |-
9
+ MmNlNTNmZjMyYTc4YTI1MDA5YTNhZjViZmI4Yjg1YzgzOTg3MjAyM2JiMDYw
10
+ NGFiYzI2ZmViNWRjZTlkYzVmNTMxZTA4Yzg3MTM5NWRhOWM1MDMwMmFkMjhi
11
+ ZDdkZmZiYjhhMjNmOWRlZjI0MWNiOTkxYjMxZDViODFjMzc4NTg=
12
+ data.tar.gz: !binary |-
13
+ YThmZTgzZWIzZjI3Mzk2YjIwNzgwZWI2ZjUyNWQ5MmFmZmE1Y2VjMTE2NzNj
14
+ Nzk5MzYwMDFmMWUxZWE3YmQxNWJhNmNlOWY1NDZjOGMxNTliNTQ1NDFjZmRi
15
+ NjMxYWIzZDk4M2EzNzE3YzVlYmIyNjcyNjljZDE3OTA2ZGI1Y2Q=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## master / 2014-03-20
2
+
3
+ * [feature] Support for `shelly ssh` command
4
+ * [improvement] Show clockwork output in deployment logs
5
+
1
6
  ## 0.4.27 / 2014-03-19
2
7
 
3
8
  * [bugfix] Don't send body with GET and HEAD requests
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 => "dbconsole")
219
+ ssh_with_db_server(:command => "start_dbconsole")
220
220
  end
221
221
 
222
222
  def mongoconsole
223
- ssh_with_db_server(:command => "mongo")
223
+ ssh_with_db_server(:command => "start_mongodb")
224
224
  end
225
225
 
226
226
  def redis_cli
227
- ssh_with_db_server(:command => "redis-cli")
227
+ ssh_with_db_server(:command => "start_redis")
228
228
  end
229
229
 
230
230
  def attributes
@@ -295,10 +295,14 @@ module Shelly
295
295
  Launchy.open("http://#{attributes["domain"]}")
296
296
  end
297
297
 
298
- def console(server = nil)
298
+ def ssh_console(server = nil)
299
299
  ssh(:server => server)
300
300
  end
301
301
 
302
+ def console(server = nil)
303
+ ssh(:command => "start_console", :server => server)
304
+ end
305
+
302
306
  def list_files(path)
303
307
  ssh(:command => "ls -l #{persistent_disk}/#{path}")
304
308
  end
@@ -64,6 +64,9 @@ module Shelly
64
64
  if content["sidekiq"]
65
65
  say("Starting sidekiq", :green); say(content["sidekiq"])
66
66
  end
67
+ if content["clockwork"]
68
+ say("Starting clockwork", :green); say(content["clockwork"])
69
+ end
67
70
  if content["thin_restart"]
68
71
  say("Starting thin", :green); say(content["thin_restart"])
69
72
  end
@@ -30,7 +30,7 @@ module Shelly
30
30
  # FIXME: it should be possible to pass single symbol, instead of one element array
31
31
  before_hook :logged_in?, :only => [:add, :status, :list, :start, :stop,
32
32
  :delete, :info, :ip, :logout, :execute, :rake, :setup, :console,
33
- :dbconsole, :mongoconsole, :redis_cli]
33
+ :dbconsole, :mongoconsole, :redis_cli, :ssh]
34
34
  before_hook :inside_git_repository?, :only => [:add, :setup, :check]
35
35
 
36
36
  map %w(-v --version) => :version
@@ -363,6 +363,20 @@ Wait until cloud is in 'turned off' state and try again.}
363
363
  say_error "Virtual server '#{options[:server]}' not found or not configured for running console"
364
364
  end
365
365
 
366
+ desc "ssh", "Log into virtual server"
367
+ method_option :cloud, :type => :string, :aliases => "-c", :desc => "Specify cloud"
368
+ method_option :server, :type => :string, :aliases => "-s",
369
+ :desc => "Specify virtual server, it's random by default"
370
+ def ssh
371
+ app = multiple_clouds(options[:cloud], "ssh")
372
+ app.ssh_console(options[:server])
373
+ rescue Client::ConflictException
374
+ say_error "Cloud #{app} is not running. Cannot run ssh console."
375
+ rescue Client::NotFoundException => e
376
+ raise unless e.resource == :virtual_server
377
+ say_error "Virtual server '#{options[:server]}' not found or not configured for running ssh console"
378
+ end
379
+
366
380
  # FIXME: move to helpers
367
381
  no_tasks do
368
382
  # Returns valid arguments for rake, removes shelly gem arguments
@@ -1,3 +1,3 @@
1
1
  module Shelly
2
- VERSION = "0.4.27"
2
+ VERSION = "0.4.28.pre"
3
3
  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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com dbconsole")
432
+ @app.should_receive(:system).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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com mongo")
441
+ @app.should_receive(:system).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(:system).with("ssh -o StrictHostKeyChecking=no -p 40010 -l foo -t -t console.example.com redis-cli")
450
+ @app.should_receive(:system).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
@@ -474,11 +474,28 @@ describe Shelly::App do
474
474
  end
475
475
  end
476
476
 
477
- describe "#console" do
477
+ describe "#ssh_console" 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
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
+ describe "#console" do
495
+ it "should run ssh with all parameters" do
496
+ @client.stub(:tunnel).and_return(
497
+ {"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 start_console")
482
499
  @app.console
483
500
  end
484
501
 
@@ -113,6 +113,8 @@ describe Shelly::CLI::Deploy do
113
113
  $stdout.should_receive(:puts).with("delayed jobs")
114
114
  $stdout.should_receive(:puts).with(green "Starting sidekiq")
115
115
  $stdout.should_receive(:puts).with("sidekiq workers")
116
+ $stdout.should_receive(:puts).with(green "Starting clockwork")
117
+ $stdout.should_receive(:puts).with("clockwork output")
116
118
  $stdout.should_receive(:puts).with(green "Starting thin")
117
119
  $stdout.should_receive(:puts).with("thins up and running")
118
120
  $stdout.should_receive(:puts).with(green "Starting puma")
@@ -135,7 +137,7 @@ describe Shelly::CLI::Deploy do
135
137
  "after_restart" => "after restart hook", "before_restart" => "before restart hook",
136
138
  "before_symlink" => "before symlink hook", "before_migrate" => "before migrate hook",
137
139
  "after_successful_deploy_hook" => "after successful deploy hook",
138
- "on_restart" => "on restart hook"
140
+ "on_restart" => "on restart hook", "clockwork" => "clockwork output"
139
141
  }
140
142
  end
141
143
  end
@@ -51,6 +51,7 @@ 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")
54
55
  out.should include("shelly redis-cli # Run redis-cli")
55
56
  out.should include("shelly register [EMAIL] # Register new account")
56
57
  out.should include("shelly setup # Set up git remotes for deployment on Shelly Cloud")
@@ -1626,6 +1627,43 @@ Wait until cloud is in 'turned off' state and try again.")
1626
1627
  end
1627
1628
  end
1628
1629
 
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
+
1629
1667
  describe "#check" do
1630
1668
  before do
1631
1669
  Shelly::App.stub(:inside_git_repository?).and_return(true)
metadata CHANGED
@@ -1,223 +1,223 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.27
4
+ version: 0.4.28.pre
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-19 00:00:00.000000000 Z
11
+ date: 2014-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.11.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.11.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: simplecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: ruby_gntp
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rb-fsevent
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fakefs
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.4.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.4.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: fakeweb
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - ! '>='
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: wijet-thor
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
131
  version: 0.14.10
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.14.10
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rest-client
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - ! '>='
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: mime-types
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ~>
158
158
  - !ruby/object:Gem::Version
159
159
  version: '1.16'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.16'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: json
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - ! '>='
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: progressbar
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - ! '>='
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - ! '>='
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: launchy
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - ! '>='
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  type: :runtime
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - ! '>='
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: netrc
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - ! '>='
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - ! '>='
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  description: Tool for managing applications and clouds at shellycloud.com
@@ -228,8 +228,8 @@ executables:
228
228
  extensions: []
229
229
  extra_rdoc_files: []
230
230
  files:
231
- - ".gitignore"
232
- - ".travis.yml"
231
+ - .gitignore
232
+ - .travis.yml
233
233
  - CHANGELOG.md
234
234
  - Gemfile
235
235
  - LICENSE
@@ -324,14 +324,14 @@ require_paths:
324
324
  - lib
325
325
  required_ruby_version: !ruby/object:Gem::Requirement
326
326
  requirements:
327
- - - ">="
327
+ - - ! '>='
328
328
  - !ruby/object:Gem::Version
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: '0'
334
+ version: 1.3.1
335
335
  requirements: []
336
336
  rubyforge_project: shelly
337
337
  rubygems_version: 2.2.2