ey_cli 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/ey_cli.gemspec +3 -2
- data/history.md +5 -0
- data/lib/ey_cli/commands/create_app.rb +2 -0
- data/lib/ey_cli/commands/create_env.rb +2 -0
- data/lib/ey_cli/commands/show.rb +16 -2
- data/lib/ey_cli/git_utils.rb +1 -1
- data/lib/ey_cli/models/base.rb +9 -2
- data/lib/ey_cli/models/deployment.rb +18 -0
- data/lib/ey_cli/models/environment.rb +5 -1
- data/lib/ey_cli/smarty_parser.rb +2 -0
- data/lib/ey_cli.rb +2 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
data/ey_cli.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'ey_cli'
|
16
|
-
s.version = '0.1.
|
17
|
-
s.date = '2011-10-
|
16
|
+
s.version = '0.1.2'
|
17
|
+
s.date = '2011-10-17'
|
18
18
|
s.rubyforge_project = 'ey_cli'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
@@ -91,6 +91,7 @@ Gem::Specification.new do |s|
|
|
91
91
|
lib/ey_cli/models/account.rb
|
92
92
|
lib/ey_cli/models/app.rb
|
93
93
|
lib/ey_cli/models/base.rb
|
94
|
+
lib/ey_cli/models/deployment.rb
|
94
95
|
lib/ey_cli/models/environment.rb
|
95
96
|
lib/ey_cli/options_parser.rb
|
96
97
|
lib/ey_cli/smarty_parser.rb
|
data/history.md
CHANGED
@@ -36,6 +36,8 @@ Options:
|
|
36
36
|
--solo A single instance for application and database.
|
37
37
|
--stack App server stack, either passenger, unicorn or trinidad.
|
38
38
|
--no_env Prevent to not create a default environment.
|
39
|
+
--app_size Size of the app instances.
|
40
|
+
--db_size Size of the db instances.
|
39
41
|
EOF
|
40
42
|
end
|
41
43
|
|
@@ -28,6 +28,8 @@ Options:
|
|
28
28
|
--db_instances number Number of database slaves.
|
29
29
|
--solo A single instance for application and database.
|
30
30
|
--stack App server stack, either passenger, unicorn or trinidad.
|
31
|
+
--app_size Size of the app instances.
|
32
|
+
--db_size Size of the db instances.
|
31
33
|
EOF
|
32
34
|
end
|
33
35
|
|
data/lib/ey_cli/commands/show.rb
CHANGED
@@ -17,7 +17,7 @@ module EYCli
|
|
17
17
|
%Q{
|
18
18
|
#{app.name}:
|
19
19
|
- Info:
|
20
|
-
+ git repository: #{app.
|
20
|
+
+ git repository: #{app.repository_uri}}
|
21
21
|
end
|
22
22
|
|
23
23
|
def status(app)
|
@@ -31,9 +31,23 @@ module EYCli
|
|
31
31
|
- stack: #{env.app_server_stack_name}
|
32
32
|
- status: #{env.instance_status}}
|
33
33
|
|
34
|
+
if deploy = env.last_deployment(app)
|
35
|
+
status << %Q{
|
36
|
+
+ last deploy info:
|
37
|
+
- commit: #{deploy.commit}
|
38
|
+
- created at: #{deploy.created_at}
|
39
|
+
- finished at: #{deploy.finished_at}
|
40
|
+
- migrated: #{deploy.migrate}}
|
41
|
+
if deploy.migrate
|
42
|
+
status << %Q{
|
43
|
+
- migrate command: #{deploy.migrate_command}}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
34
47
|
if env.instances
|
35
48
|
status << %Q{
|
36
|
-
|
49
|
+
|
50
|
+
- Status per instance:}
|
37
51
|
env.instances.each do |instance|
|
38
52
|
status << %Q{
|
39
53
|
+ #{instance.role}:
|
data/lib/ey_cli/git_utils.rb
CHANGED
data/lib/ey_cli/models/base.rb
CHANGED
@@ -27,8 +27,15 @@ module EYCli
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.resolve_child_path(args)
|
30
|
-
collection_path
|
31
|
-
|
30
|
+
"#{collection_path(args[0..-1])}/#{args.last}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.child_path(args)
|
34
|
+
resolve_child_path(args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.collection_path(args)
|
38
|
+
base_path % args
|
32
39
|
end
|
33
40
|
|
34
41
|
def self.create(hash)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module EYCli
|
2
|
+
module Model
|
3
|
+
class Deployment < Base
|
4
|
+
base_path 'apps/%s/environments/%s/deployments'
|
5
|
+
|
6
|
+
def self.deploy_path(app, environment)
|
7
|
+
collection_path([app.id, environment.id]) + '/deploy'
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.last_deployment(app, environment)
|
11
|
+
find(app.id, environment.id, 'last')
|
12
|
+
rescue Faraday::Error::ClientError => e # there is no last deployment if we never deployed the app
|
13
|
+
raise e unless e.response[:status] == 404
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -25,7 +25,11 @@ module EYCli
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def deploy_path(app)
|
28
|
-
|
28
|
+
Deployment.deploy_path(app, self)
|
29
|
+
end
|
30
|
+
|
31
|
+
def last_deployment(app)
|
32
|
+
Deployment.last_deployment(app, self)
|
29
33
|
end
|
30
34
|
end
|
31
35
|
end
|
data/lib/ey_cli/smarty_parser.rb
CHANGED
@@ -20,6 +20,8 @@ module EYCli
|
|
20
20
|
hash[key] = parse(value, EYCli::Model::App)
|
21
21
|
when /environments?/
|
22
22
|
hash[key] = parse(value, EYCli::Model::Environment)
|
23
|
+
when /deployments?/
|
24
|
+
hash[key] = parse(value, EYCli::Model::Deployment)
|
23
25
|
else
|
24
26
|
hash[key] = parse(value, Hashie::Mash)
|
25
27
|
end
|
data/lib/ey_cli.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module EYCli
|
2
|
-
VERSION = '0.1.
|
2
|
+
VERSION = '0.1.2'
|
3
3
|
|
4
4
|
require 'hashie/mash'
|
5
5
|
require 'json'
|
@@ -16,6 +16,7 @@ module EYCli
|
|
16
16
|
require 'ey_cli/models/base'
|
17
17
|
require 'ey_cli/models/account'
|
18
18
|
require 'ey_cli/models/app'
|
19
|
+
require 'ey_cli/models/deployment'
|
19
20
|
require 'ey_cli/models/environment'
|
20
21
|
|
21
22
|
require 'ey_cli/controllers/accounts'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ey_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Calavera
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- lib/ey_cli/models/account.rb
|
225
225
|
- lib/ey_cli/models/app.rb
|
226
226
|
- lib/ey_cli/models/base.rb
|
227
|
+
- lib/ey_cli/models/deployment.rb
|
227
228
|
- lib/ey_cli/models/environment.rb
|
228
229
|
- lib/ey_cli/options_parser.rb
|
229
230
|
- lib/ey_cli/smarty_parser.rb
|