ebfly 0.0.1 → 0.0.2

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,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caddbe101734e059c894728ac1198a1705df2cbe
4
- data.tar.gz: 1c2946180f78e71d7539f4730fafacbc191904ac
3
+ metadata.gz: c89ec5eb6ba42bccb9da25f1ee5cdaaa319c7af5
4
+ data.tar.gz: 0f491907d37f7a4b2a60591b96893067d23d411f
5
5
  SHA512:
6
- metadata.gz: 359ca0f932e298ba91d7ff51580d1055b4107279882ca6369d04b0455d99dfcef134fea4e6b3cb04ed5263a7912d2ad6094e40c4f6c7d66906851d2d647b971b
7
- data.tar.gz: 6075acb96e091bdc49cbdac40182e2e476efcc1f20ef5c491e30dcbe40688c873df3012bbf09050a66231e278c00b653fe0527173837ed930aa7c6b7f0931066
6
+ metadata.gz: 9f24ac352294b6b5a9dc1a5bc87b7f04e73b4444bcd29ef06075cd2c63975883c2269299861bb79c9fbca34206c1c804455b0572639afd237d1d1b2478835bfb
7
+ data.tar.gz: f7c7f7a1c29141fe421a2b4aa6260e9b0b16071b627c1053844a816fea775855d79e72a647d8bd7e5435c04399c021e04d8f57b8e1b5f63c69bd9fed3c0a0fd1
data/README.md CHANGED
@@ -35,6 +35,14 @@ export AWS_SECRET_ACCESS_KEY='...'
35
35
  export AWS_REGION='us-east-1'
36
36
  ```
37
37
 
38
+ ## Documents
39
+
40
+ Documents for each command is available on [docs](./docs).
41
+
42
+ - [app](./docs/app.md)
43
+ - [env](./docs/env.md)
44
+ - [config](./docs/config.md)
45
+
38
46
  ## Quick Start
39
47
 
40
48
  If you want to deploy sinatra app, you should do following step.
@@ -62,7 +70,7 @@ Create app: sinatraapp ...
62
70
  application name: sinatraapp
63
71
  description:
64
72
  created at: 2014-02-25 08:43:30 UTC
65
- updated at: application name: 2014-02-25 08:43:30 UTC
73
+ updated at: 2014-02-25 08:43:30 UTC
66
74
  configuration_templates:
67
75
  ```
68
76
 
@@ -129,43 +137,36 @@ Deploy app's `master` branch to environment using `ebfly env push` command.
129
137
  ```sh
130
138
  # Usage: "ebfly push <name> <branch or tree_ish>".
131
139
  $ ebfly env push dev master -a sinatraapp
140
+ ```
132
141
 
133
- === environment info ===
134
- application name: sinatraapp
135
- environment id: e-wwdh3u39bg
136
- environment name: sinatraapp-dev
137
- description:
138
- status: Ready
139
- health: Green
140
- tier: WebServer Standard 1.0
141
- solution stack name: 64bit Amazon Linux 2013.09 running Ruby 1.9.3
142
- endpoint url: awseb-e-w-AWSEBLoa-18QJHE7KJ67YX-1070649090.us-east-1.elb.amazonaws.com
143
- cname: sinatraapp-dev-esfmkp3rgk.elasticbeanstalk.com
144
- updated at: 2014-02-25 08:50:51 UTC
142
+ You need to wait some time to change application's status to `READY`.
143
+ You can get environment information using 'ebfly env info' command.
145
144
 
146
- Create archive: git-8e81464455269535c89149643ba50fab5cfa82da-1393318559.zip
147
- Upload archive git-8e81464455269535c89149643ba50fab5cfa82da-1393318559.zip to s3://elasticbeanstalk-us-east-1-283381710361
148
- Create application version: 8e81464455269535c89149643ba50fab5cfa82da-1393318559
149
- Update environment: sinatraapp-dev to 8e81464455269535c89149643ba50fab5cfa82da-1393318559
145
+ ```
146
+ $ ebfly env info dev -a sinatraapp
150
147
 
151
148
  === environment info ===
152
- application name: sinatraapp
153
- environment id: e-wwdh3u39bg
154
- environment name: sinatraapp-dev
149
+ application name: sinatraapp
150
+ environment id: e-XXX
151
+ environment name: sinatraapp-dev
155
152
  description:
156
- status: Updating
157
- health: Grey
158
- tier: WebServer Standard 1.0
153
+ status: Ready
154
+ health: Green
155
+ tier: WebServer Standard 1.0
159
156
  solution stack name: 64bit Amazon Linux 2013.09 running Ruby 1.9.3
160
- endpoint url: awseb-e-w-AWSEBLoa-18QJHE7KJ67YX-1070649090.us-east-1.elb.amazonaws.com
161
- cname: sinatraapp-dev-esfmkp3rgk.elasticbeanstalk.com
162
- version label: 8e81464455269535c89149643ba50fab5cfa82da-1393318559
163
- updated at: 2014-02-25 08:56:01 UTC
157
+ endpoint url: awseb-e-w-XXXXXXXXXXXXXXXX-1111111111.us-east-1.elb.amazonaws.com
158
+ cname: sinatraapp-dev-xyz.elasticbeanstalk.com
164
159
  ```
165
160
 
166
- ### Step 7 Open app
161
+ When `status` turns `Ready`, your can access your app on `http://[cname]`.
162
+ Copy and paste `cname` value on your browser.
167
163
 
164
+ If you are using Mac OS, `ebfly env open` command is very useful.
165
+ `ebfly env open`command open specified environment app on your browser.
168
166
 
167
+ ```
168
+ $ ebfly env open dev -a sinatraapp
169
+ ```
169
170
 
170
171
  ## License
171
172
 
data/docs/app.md ADDED
@@ -0,0 +1,66 @@
1
+ # app
2
+
3
+ `app` is a command for managing ElasticBeanstalk application.
4
+
5
+ ## Subcommands
6
+
7
+ - [create](#create)
8
+ - [delete](#delete)
9
+ - [info](#info)
10
+ - [versions](#versions)
11
+
12
+ <a name="create"></a>
13
+ ### create
14
+
15
+ Create an application.
16
+
17
+ ```
18
+ ebfly app create [name] -d [desc]
19
+ ```
20
+
21
+ #### Options
22
+
23
+ | Name | Description | Required |
24
+ | ---- | ----------------------------------- | -------- |
25
+ | -d | The description of the application. | No |
26
+
27
+ <a name="delete"></a>
28
+ ### delete
29
+
30
+ Delete the specified application.
31
+
32
+ ```
33
+ ebfly app delete [name] -f
34
+ ```
35
+
36
+ #### Options
37
+
38
+ | Name | Description | Required |
39
+ | ---- | ----------------------------------------------------------------------------------------- | -------- |
40
+ | -f | Determines if all running environments should be deleted before deleting the application. | No |
41
+
42
+ <a name="info"></a>
43
+ ### info
44
+
45
+ Show the specified application information.
46
+
47
+ ```
48
+ ebfly app info [name]
49
+ ```
50
+
51
+ #### Options
52
+
53
+ None
54
+
55
+ <a name="versions"></a>
56
+ ### versions
57
+
58
+ Show the application versions of specified application.
59
+
60
+ ```
61
+ ebfly app versions [name]
62
+ ```
63
+
64
+ #### Options
65
+
66
+ None
data/docs/config.md ADDED
@@ -0,0 +1,83 @@
1
+ # config
2
+
3
+ `config` is a command for managing environment's config vars.
4
+ config vars means `aws:elasticbeanstalk:application:environment` namespace values. See [here](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html)
5
+
6
+ ## Subcommands
7
+
8
+ - [add](#add)
9
+ - [rm](#rm)
10
+ - [show](#show)
11
+ - [versions](#versions)
12
+
13
+ <a name="add"></a>
14
+ ### add
15
+
16
+ Add config vars to the specified environment.
17
+
18
+ ```
19
+ ebfly config add -a [app] -e [env] -c [key1=value1 key2=value2 ...]
20
+ ```
21
+
22
+ #### Options
23
+
24
+ | Name | Description | Required |
25
+ | ---- | ------------------------------------------------------------------------------------------ | -------- |
26
+ | -a | The name of the application to add config vars. | Yes |
27
+ | -e | The name of the environment to add config vars. | Yes |
28
+ | -c | The config vars formated `key=value`. Each key-value pair must be separated by whitespace. | Yes |
29
+
30
+ #### Examples
31
+
32
+ - Set `RACK_ENV` to `production`.
33
+
34
+ ```
35
+ ebfly config add -a app -e env -c RACK_ENV=production
36
+ ```
37
+
38
+ - Set `ENV1` to `val1' and 'ENV2' to 'val2'.
39
+
40
+ ```
41
+ ebfly config add -a app -e env -c ENV1=val1 ENV2=val2
42
+ ```
43
+
44
+ <a name="rm"></a>
45
+ ### rm
46
+
47
+ Remove config vars of the specified environment.
48
+
49
+ ```
50
+ ebfly config rm -a [app] -e [env] -c [key1 key2 ...]
51
+ ```
52
+
53
+ #### Options
54
+
55
+ | Name | Description | Required |
56
+ | ---- | --------------------------------------------------------------------------- | -------- |
57
+ | -a | The name of the application to remove config vars. | Yes |
58
+ | -e | The name of the environment to remove config vars. | Yes |
59
+ | -c | The config vars keys to remove. Each value must be separated by whitespace. | Yes |
60
+
61
+ #### Examples
62
+
63
+ Remove `ENV1` and `ENV2`.
64
+
65
+ ```
66
+ ebfly config rm -a app -e env -c ENV1 ENV2
67
+ ```
68
+
69
+ <a name="show"></a>
70
+ ### show
71
+
72
+ Show config vars of the specified environment.
73
+
74
+ ```
75
+ ebfly config show -a [app] -e [env]
76
+ ```
77
+
78
+ #### Options
79
+
80
+ | Name | Description | Required |
81
+ | ---- | --------------------------------------------------------------------------- | -------- |
82
+ | -a | The name of the application to remove config vars. | Yes |
83
+ | -e | The name of the environment to remove config vars. | Yes |
data/docs/env.md ADDED
@@ -0,0 +1,132 @@
1
+ # env
2
+
3
+ `env` is a command for managing ElasticBeanstalk environment.
4
+
5
+ ## Subcommands
6
+
7
+ - [create](#create)
8
+ - [delete](#delete)
9
+ - [info](#info)
10
+ - [open](#open)
11
+ - [push](#push)
12
+
13
+ <a name="create"></a>
14
+ ### create
15
+
16
+ Create an environment.
17
+
18
+ ```
19
+ ebfly env create [name] -a [app] -s [stack] -t [tier] -l [label] -d [desc]
20
+ ```
21
+
22
+ #### Options
23
+
24
+ | Name | Description | Required |
25
+ | ---- | ---------------------------------------------------------------------------------------------- | -------- |
26
+ | -a | The application name to create environment. | Yes |
27
+ | -s | The Solution stack name to create. Some [predefined values](#predefined_values) are available. | Yes |
28
+ | -t | Tier type, value must be `web` or `worker`. Default value is `web` | No |
29
+ | -l | The name of the application version to deploy | No |
30
+ | -d | The description of the application. | No |
31
+
32
+ #### Examples
33
+
34
+ Create Ruby 1.9 web environment.
35
+
36
+ ```
37
+ ebfly env create envname -a app -s ruby19 -t web
38
+ ```
39
+
40
+ Create Python 2.7 worker environment.
41
+
42
+ ```
43
+ ebfly env create envname -a app -s python27 -t worker
44
+ ```
45
+
46
+ <a name="predefined_values"></a>
47
+ #### Predefined solution stack name
48
+
49
+ | Name | Defined value |
50
+ | -------- | -------------------------------------------------- |
51
+ | java7 | 64bit Amazon Linux 2013.09 running Tomcat 7 Java 7 |
52
+ | java6 | 64bit Amazon Linux 2013.09 running Tomcat 7 Java 6 |
53
+ | nodejs | 64bit Amazon Linux 2013.09 running Node.js |
54
+ | php53 | 64bit Amazon Linux running PHP 5.3 |
55
+ | php54 | 64bit Amazon Linux 2013.09 running PHP 5.4 |
56
+ | php55 | 64bit Amazon Linux 2013.09 running PHP 5.5 |
57
+ | python27 | 64bit Amazon Linux 2013.09 running Python 2.7 |
58
+ | ruby18 | 64bit Amazon Linux 2013.09 running Ruby 1.8.7 |
59
+ | ruby19 | 64bit Amazon Linux 2013.09 running Ruby 1.9.3 |
60
+
61
+ <a name="delete"></a>
62
+ ### delete
63
+
64
+ Delete the specified environment.
65
+
66
+ ```
67
+ ebfly env delete [name] -a [app]
68
+ ```
69
+
70
+ #### Options
71
+
72
+ | Name | Description | Required |
73
+ | ---- | ------------------------------------------- | -------- |
74
+ | -a | The application name to create environment. | Yes |
75
+
76
+ <a name="info"></a>
77
+ ### info
78
+
79
+ Show the specified environment information.
80
+
81
+ ```
82
+ ebfly env info [name] -a [app]
83
+ ```
84
+
85
+ #### Options
86
+
87
+ | Name | Description | Required |
88
+ | ---- | ------------------------------------------- | -------- |
89
+ | -a | The application name to create environment. | Yes |
90
+ | -r | Show environment resources. | No |
91
+
92
+ <a name="open"></a>
93
+ ### open
94
+
95
+ Open environment CNAME in browser (Mac OS Only)
96
+
97
+ ```
98
+ ebfly env open [name] -a [app]
99
+ ```
100
+
101
+ #### Options
102
+
103
+ None
104
+
105
+ <a name="push"></a>
106
+ ### push
107
+
108
+ Push and deploy the specified branch to the environment.
109
+
110
+ ```
111
+ ebfly env push [name] [branch or tree_ish] -a [app]
112
+ ```
113
+
114
+ #### Options
115
+
116
+ | Name | Description | Required |
117
+ | ---- | ------------------------------------------- | -------- |
118
+ | -a | The application name to create environment. | Yes |
119
+
120
+ #### Examples
121
+
122
+ Push `master` branch to the environment.
123
+
124
+ ```
125
+ ebfly env push envname master -a app
126
+ ```
127
+
128
+ Push specified commit `66c598c` to the environment.
129
+
130
+ ```
131
+ ebfly env push envname 66c598c -a app
132
+ ```
data/lib/ebfly/cli.rb CHANGED
@@ -17,10 +17,10 @@ module Ebfly
17
17
  desc "app SUBCOMMAND ...ARGS", "manage application"
18
18
  subcommand "app", App
19
19
 
20
- desc "env SUBCOMMAND ...ARGS -a APP", "manager environment"
20
+ desc "env SUBCOMMAND ...ARGS", "manage environment"
21
21
  subcommand "env", Environment
22
22
 
23
- desc "config SUBCOMMAND ...ARGS -a APP", "manager environment's config vars"
23
+ desc "config SUBCOMMAND ...ARGS", "manage environment's config vars"
24
24
  subcommand "config", Config
25
25
  end
26
26
  end
@@ -2,7 +2,7 @@ module Ebfly
2
2
  class App < Thor
3
3
  include Command
4
4
 
5
- desc "create <name>", "Create an application named <name>"
5
+ desc "create <name>", "Create an application"
6
6
  option :d, :banner => "<description>", :desc => "Describes the application"
7
7
  def create(name)
8
8
  puts "Create app: #{name} ..."
@@ -15,7 +15,7 @@ module Ebfly
15
15
  show_app_info(ret[:application])
16
16
  end
17
17
 
18
- desc "delete <name>", "Delete an application named <name>"
18
+ desc "delete <name>", "Delete the specified application"
19
19
  option :f, :desc => "Terminate running environment by force", :default => false, :type => :boolean
20
20
  def delete(name)
21
21
  puts "Delete app: #{name} ..."
@@ -28,7 +28,7 @@ module Ebfly
28
28
  puts "Done"
29
29
  end
30
30
 
31
- desc "info <name>", "Show information of the application"
31
+ desc "info <name>", "Show the specified application information"
32
32
  def info(name)
33
33
  begin
34
34
  inf = app_info(name)
@@ -40,7 +40,7 @@ module Ebfly
40
40
  end
41
41
  end
42
42
 
43
- desc "versions <name>", "Show the application versions"
43
+ desc "versions <name>", "Show the application versions of specified application"
44
44
  def versions(name)
45
45
  opts = {
46
46
  application_name: name
@@ -2,10 +2,9 @@ module Ebfly
2
2
  class Config < Thor
3
3
  include Command
4
4
 
5
- class_option :a, :required => true, :banner => "<application-name>", :desc => "Application name"
6
- class_option :e, :required => true, :banner => "<environment-name>", :desc => "Environment name"
7
-
8
- desc "show", "Show environment's config vars"
5
+ desc "show", "Show config vars of the specified environment"
6
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
7
+ option :e, :required => true, :banner => "<env>", :desc => "Environment name"
9
8
  def show
10
9
  app = options[:a]
11
10
  env = options[:e]
@@ -20,14 +19,18 @@ module Ebfly
20
19
  show_env_conf(app, env, ret)
21
20
  end
22
21
 
23
- desc "rm", "Add configuration ot the environment"
22
+ desc "add", "Add config vars to the specified environment"
23
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
24
+ option :e, :required => true, :banner => "<env>", :desc => "Environment name"
24
25
  option :c, :required => true, :banner => "<key1=value1 key2=value2 ...>", :type => :array, :desc => "Config vars"
25
26
  def add
26
27
  ret = add_environment_config(options[:a], options[:e], options[:c])
27
28
  debug(ret)
28
29
  end
29
30
 
30
- desc "rm", "Remove configuration ot the environment"
31
+ desc "rm", "Remove config vars of the specified environment"
32
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
33
+ option :e, :required => true, :banner => "<env>", :desc => "Environment name"
31
34
  option :c, :required => true, :banner => "<key1 key2 ...>", :type => :array, :desc => "Config vars"
32
35
  def rm
33
36
  ret = remove_environment_config(options[:a], options[:e], options[:c])
@@ -2,13 +2,12 @@ module Ebfly
2
2
  class Environment < Thor
3
3
  include Command
4
4
 
5
- class_option :a, :required => true, :banner => "<application-name>", :desc => "Application name"
6
-
7
- desc "create <name>", "Create a environment named <name>"
8
- option :s, :required => true, :banner => "<solution stack name>", :desc => "This is an alternative to specifying a configuration name"
9
- option :t, :banner => "<type>", :default => "web", :desc => "tier type, web or worker"
5
+ desc "create <name>", "Create an environment named <name>"
6
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
7
+ option :s, :required => true, :banner => "<stack>", :desc => "The Solution stack name"
8
+ option :t, :banner => "<tier>", :default => "web", :desc => "Tier type (web|worker)"
10
9
  option :d, :banner => "<description>", :desc => "Describes the environment"
11
- option :v, :banner => "<version label>", :desc => "The name of the application version to deploy"
10
+ option :l, :banner => "<label>", :desc => "The name of the application version to deploy"
12
11
  def create(name)
13
12
  app = options[:a]
14
13
  puts "Create environment: #{env_name(app, name)} ..."
@@ -26,7 +25,8 @@ module Ebfly
26
25
  show_env_info(ret)
27
26
  end
28
27
 
29
- desc "delete <name>", "Delete the environment named <name>"
28
+ desc "delete <name>", "Delete the specified environment"
29
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
30
30
  def delete(name)
31
31
  app = options[:a]
32
32
  puts "Delete environment: #{env_name(app, name)} ..."
@@ -37,8 +37,9 @@ module Ebfly
37
37
  puts "Done"
38
38
  end
39
39
 
40
- desc "info <name>", "Show information of the enviroment"
41
- option :r, :default => false, :desc => "Show environment resources info"
40
+ desc "info <name>", "Show the specified environment information."
41
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
42
+ option :r, :default => false, :desc => "Show environment resources"
42
43
  def info(name)
43
44
  app = options[:a]
44
45
  begin
@@ -57,7 +58,8 @@ module Ebfly
57
58
  end
58
59
  end
59
60
 
60
- desc "open <name>", "Open environment in browser (Mac OS Only)"
61
+ desc "open <name>", "Open environment CNAME in browser (Mac OS Only)"
62
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
61
63
  def open(name)
62
64
  raise "This feature can run on Mac OS Only" unless exist_command?('open')
63
65
 
@@ -66,7 +68,8 @@ module Ebfly
66
68
  system "open #{url}"
67
69
  end
68
70
 
69
- desc "push <name> <branch or tree_ish>", "Push and deploy specified branch to environment"
71
+ desc "push <name> <branch or tree_ish>", "Push and deploy the specified branch to the environment"
72
+ option :a, :required => true, :banner => "<app>", :desc => "Application name"
70
73
  def push(name, branch)
71
74
  raise "git must be installed" unless exist_command?('git')
72
75
  app = options[:a]
data/lib/ebfly/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ebfly
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebfly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyuki Honda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -51,6 +51,9 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - bin/ebfly
54
+ - docs/app.md
55
+ - docs/config.md
56
+ - docs/env.md
54
57
  - ebfly.gemspec
55
58
  - lib/ebfly/cli.rb
56
59
  - lib/ebfly/command/app.rb