ey_cli 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/ey_cli.gemspec CHANGED
@@ -13,7 +13,7 @@ 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.2.1'
16
+ s.version = '0.3.0'
17
17
  s.date = '2012-04-09'
18
18
  s.rubyforge_project = 'ey_cli'
19
19
 
data/history.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.0 (12-04-09)
2
+
3
+ - `--db_stack` option available for `create_env` and `create_app`
4
+
1
5
  ## 0.2.1 (12-04-09)
2
6
 
3
7
  - Force slop 2.4.4; as slow 3.0+ introduces a regression
data/lib/ey_cli.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module EYCli
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
 
4
4
  require 'hashie/mash'
5
5
  require 'json'
@@ -40,6 +40,7 @@ Options:
40
40
  --db_instances number Number of database slaves.
41
41
  --solo A single instance for application and database.
42
42
  --stack App server stack, either passenger, unicorn or trinidad.
43
+ --db_stack DB stack, either mysql/mysql5_0, mysql5_5, or postgresql/postgres9_1
43
44
  --no_env Prevent to not create a default environment.
44
45
  --app_size Size of the app instances.
45
46
  --db_size Size of the db instances.
@@ -67,6 +68,7 @@ EOF
67
68
  #on :util_instances, true, :as => :integer # FIXME: utils instances are handled differently
68
69
  on :solo, false, :default => false
69
70
  on :stack, true, :matches => /passenger|unicorn|puma|thin|trinidad/
71
+ on :db_stack, true, :matches => /mysql|postgresql/
70
72
  on :no_env, false, :default => false
71
73
  on :app_size, true do |size|
72
74
  CreateEnv::EnvParser.check_instance_size(size)
@@ -30,6 +30,7 @@ Options:
30
30
  --db_instances number Number of database slaves.
31
31
  --solo A single instance for application and database.
32
32
  --stack App server stack, either passenger, unicorn or trinidad.
33
+ --db_stack DB stack, either mysql/mysql5_0, mysql5_5, or postgresql/postgres9_1
33
34
  --app_size Size of the app instances.
34
35
  --db_size Size of the db instances.
35
36
  EOF
@@ -54,6 +55,7 @@ EOF
54
55
  #on :util_instances, true, :as => :integer # FIXME: utils instances are handled differently
55
56
  on :solo, false, :default => false
56
57
  on :stack, true, :matches => /passenger|unicorn|puma|thin|trinidad/
58
+ on :db_stack, true, :matches => /mysql|postgresql/
57
59
  on :app_size, true do |size|
58
60
  EnvParser.check_instance_size(size)
59
61
  end
@@ -78,10 +80,11 @@ EOF
78
80
  end
79
81
 
80
82
  def fill_create_env_options(options)
81
- opts = {
83
+ opts = {
82
84
  :name => (options[:env_name] || options[:name]),
83
85
  :framework_env => options[:framework_env],
84
86
  :stack => options[:stack],
87
+ :db_stack => options[:db_stack],
85
88
  :ruby_version => options[:ruby_version]
86
89
  }
87
90
 
@@ -92,15 +95,22 @@ EOF
92
95
  when :trinidad then opts[:ruby_version] = 'JRuby'
93
96
  end
94
97
  end
98
+
99
+ if opts[:db_stack]
100
+ case opts[:db_stack].to_sym
101
+ when :mysql then opts[:db_stack] = 'mysql5_0'
102
+ when :postgresql then opts[:db_stack] = 'postgres9_1'
103
+ end
104
+ end
95
105
 
96
106
  if options[:app_instances] || options[:db_instances] || options[:solo] ||
97
107
  options[:app_size] || options[:db_size]
98
108
  cluster_conf = options.dup
99
109
  if options[:solo]
100
- EYCli.term.say('~> creating solo environment, ignoring instance numbers')
110
+ EYCli.term.say('~> creating solo environment')
101
111
  cluster_conf[:configuration] = 'single'
102
112
  else
103
- cluster_conf[:configuration] = 'custom'
113
+ cluster_conf[:configuration] = 'custom'
104
114
  end
105
115
 
106
116
  opts[:cluster_configuration] = cluster_conf
@@ -28,8 +28,8 @@ module EYCli
28
28
  status << %Q{
29
29
  + #{env.name}:
30
30
  - environment: #{env.framework_env}
31
+ - app stack: #{env.app_server_stack_name}
31
32
  - IP address: #{env.load_balancer_ip_address}
32
- - stack: #{env.app_server_stack_name}
33
33
  - status: #{env.instance_status}}
34
34
 
35
35
  if deploy = env.last_deployment(app)
@@ -47,6 +47,7 @@ module EYCli
47
47
  }
48
48
  if options[:configuration] == 'custom'
49
49
  cluster['cluster_configuration[app_server_count]'] = options[:app_instances] || 2
50
+ cluster['cluster_configuration[use_separate_db]'] = options[:use_separate_db] || 'true'
50
51
  cluster['cluster_configuration[db_slave_count]'] = options[:db_instances] || 0
51
52
  cluster['cluster_configuration[instance_size]'] = options[:app_size] if options[:app_size]
52
53
  cluster['cluster_configuration[db_instance_size]'] = options[:db_size] if options[:db_size]
@@ -58,6 +59,7 @@ module EYCli
58
59
  custom = {}
59
60
  custom['app_deployment[new][domain_name]'] = options[:url] if options[:url]
60
61
  custom['environment[app_server_stack_name]'] = options[:stack] if options[:stack]
62
+ custom['environment[db_stack_name]'] = options[:db_stack] if options[:db_stack]
61
63
  custom['environment[ruby_version]'] = options[:ruby_version] if options[:ruby_version]
62
64
  custom
63
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ey_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
- requirement: &70186120190660 !ruby/object:Gem::Requirement
16
+ requirement: &70229783122120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70186120190660
24
+ version_requirements: *70229783122120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: faraday_middleware
27
- requirement: &70186120190120 !ruby/object:Gem::Requirement
27
+ requirement: &70229783121240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70186120190120
35
+ version_requirements: *70229783121240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: faraday-stack
38
- requirement: &70186120189660 !ruby/object:Gem::Requirement
38
+ requirement: &70229783120200 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70186120189660
46
+ version_requirements: *70229783120200
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: highline
49
- requirement: &70186120189200 !ruby/object:Gem::Requirement
49
+ requirement: &70229783119540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70186120189200
57
+ version_requirements: *70229783119540
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: hashie
60
- requirement: &70186120188660 !ruby/object:Gem::Requirement
60
+ requirement: &70229783118800 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70186120188660
68
+ version_requirements: *70229783118800
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: json
71
- requirement: &70186120188120 !ruby/object:Gem::Requirement
71
+ requirement: &70229783117600 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70186120188120
79
+ version_requirements: *70229783117600
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: multi_json
82
- requirement: &70186120187540 !ruby/object:Gem::Requirement
82
+ requirement: &70229783116580 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70186120187540
90
+ version_requirements: *70229783116580
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: slop
93
- requirement: &70186120186680 !ruby/object:Gem::Requirement
93
+ requirement: &70229783115800 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - =
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 2.4.4
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70186120186680
101
+ version_requirements: *70229783115800
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rake
104
- requirement: &70186120185640 !ruby/object:Gem::Requirement
104
+ requirement: &70229783135260 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0.9'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70186120185640
112
+ version_requirements: *70229783135260
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
- requirement: &70186120184440 !ruby/object:Gem::Requirement
115
+ requirement: &70229783160960 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70186120184440
123
+ version_requirements: *70229783160960
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: webmock
126
- requirement: &70186120183980 !ruby/object:Gem::Requirement
126
+ requirement: &70229783239580 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70186120183980
134
+ version_requirements: *70229783239580
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: fakefs
137
- requirement: &70186120199620 !ruby/object:Gem::Requirement
137
+ requirement: &70229783186020 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: 0.3.2
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70186120199620
145
+ version_requirements: *70229783186020
146
146
  description: More user friendly CLI for Engine Yard cloud. Use undocumented APIs
147
147
  email: david.calavera@gmail.com
148
148
  executables:
@@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: -1956038389853527985
215
+ hash: 632789376249481008
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  none: false
218
218
  requirements: