Ebfly is a simple command line interface for AWS ElasticBeanstalk.
- Ruby 1.9+
- git
ebfly only support following platforms.
- Docker
- Node.js
- PHP
- Python
- Ruby
Ebfly can be install via gem:
$ gem install ebfly
After install, you can use ebfly
command.
You need to create $HOME/.ebfly
and specify following values.
AWS_ACCESS_KEY_ID='...'
AWS_SECRET_ACCESS_KEY='...'
AWS_REGION='us-east-1'
or you can also specify these values via ENV
:
export AWS_ACCESS_KEY_ID='...'
export AWS_SECRET_ACCESS_KEY='...'
export AWS_REGION='us-east-1'
Documents for each command is available on docs.
If you want to deploy sinatra app, you should do following step.
Create working directory, and create git repository.
$ mkdir sinatraapp
$ cd sinatraapp
$ git init .
Create application using ebfly app create
command.
# Usage: "ebfly app create <application-name>"
$ ebfly app create sinatraapp
Create app: sinatraapp ...
=== application info ===
application name: sinatraapp
description:
created at: 2014-02-25 08:43:30 UTC
updated at: 2014-02-25 08:43:30 UTC
configuration_templates:
Create environment using 'ebfly env create' command.
# Usage: "ebfly env create <environment-name> -a <application-name> -s <solution_stack_name> -t <tier-type>
$ ebfly env create dev -a sinatraapp -s ruby19 -t web
Create environment: sinatraapp-dev ...
=== environment info ===
application name: sinatraapp
environment id: e-XXX
environment name: sinatraapp-dev
description:
status: Launching
health: Grey
tier: WebServer Standard 1.0
solution stack name: 64bit Amazon Linux 2013.09 running Ruby 1.9.3
updated at: 2014-02-25 08:45:39 UTC
Create config.ru
, helloworld.rb
and Gemfile
like this:
require './helloworld'
run Sinatra::Application
require 'sinatra'
get '/' do
"Hello World!"
end
source 'http://rubygems.org'
gem 'sinatra'
$ bundle install
$ git add .
$ git commit -m "First commit"
Deploy app's master
branch to environment using ebfly env push
command.
# Usage: "ebfly push <name> <branch or tree_ish>".
$ ebfly env push dev master -a sinatraapp
You need to wait some time to change application's status to READY
.
You can get environment information using 'ebfly env info' command.
$ ebfly env info dev -a sinatraapp
=== environment info ===
application name: sinatraapp
environment id: e-XXX
environment name: sinatraapp-dev
description:
status: Ready
health: Green
tier: WebServer Standard 1.0
solution stack name: 64bit Amazon Linux 2013.09 running Ruby 1.9.3
endpoint url: awseb-e-w-XXXXXXXXXXXXXXXX-1111111111.us-east-1.elb.amazonaws.com
cname: sinatraapp-dev-xyz.elasticbeanstalk.com
When status
turns Ready
, your can access your app on http://[cname]
.
Copy and paste cname
value on your browser.
If you are using Mac OS, ebfly env open
command is very useful.
ebfly env open
command open specified environment app on your browser.
$ ebfly env open dev -a sinatraapp
This tool is distributed under the Apache License, Version 2.0.