A Rack package to launch your Ember.js application into the Cloud.
Ember CLI Deploy Rack can be used to serve an Ember CLI application deployed with the help of Ember CLI Deploy and ember-deploy-redis.
Basically, it is a Sinatra application, which connects to Redis and returns the uploaded index.html.
You can deploy your application to production, test it out by passing an revision
parameter with the revision you want
to test and activate when you feel confident that everything is working as expected.
For further information see Ember CLI Deploy.
Create a Gemfile
#!/usr/bin/env bundle
source 'https://rubygems.org'
gem 'ember-cli-deploy-rack', require: false
Run bundle
to install all dependencies with Bundler
Create a Rack configuration
#!/usr/bin/env rackup
# This file is used by Rack-based servers to start the application.
require 'bundler/setup'
require 'ember/cli/deploy/rack'
run Ember::CLI::Deploy::Rack::Engine
Run the engine with rackup
or your favorite Ruby Webserver
Ember CLI Deploy Rack can be configured in various ways:
Via settings
engine = Ember::CLI::Deploy::Rack::Engine.new
# === Settings ====
# engine.settings.set :root, Dir.pwd
# engine.settings.set :key_prefix, 'ember-cli-deploy-rack:index'
# engine.settings.set :active_content_suffix, 'current-content'
# engine.settings.set :revision, { regexp: '^[0-9a-f]{32}$' }
# engine.settings.set :redis, { host: '127.0.0.1', ... }
# engine.settings.set :redis_client, proc { Redis.new settings.redis }
# engine.settings.set :debug, false
# ...
# === Logging ====
# log_dir = File.expand_path 'log'
#
# if File.directory? log_dir
# log_file = File.expand_path "#{engine.settings.environment}.log", log_dir
#
# logger = Logger.new log_file, File::WRONLY | File::APPEND | File::CREAT
# logger.level = Logger::ERROR
#
# engine.settings.set :logger, logger
# end
run engine
Via YAML configuration file
Just create a configuration file config/settings.yml
and adjust properly, for an example see
resources/config/settings.yml.
The prefix to be used for the Redis key under which file will be uploaded to Redis. The Redis key will be a combination
of the key_prefix
and the revision_key
. Typically this is the project.name
property from the deployment context
and :index
at the end. By default this option will be ember-cli-deploy-rack:index
.
For more details, see https://github.com/ember-cli-deploy/ember-cli-deploy-redis#keyprefix.
The suffix to be used for the Redis key under which the activated revision content will be stored in Redis. By default
this option will be current-content
. This makes the default activated revision in Redis looks like: The project.name
property from the deployment and :index:current-content
at the end.
For more details, see https://github.com/ember-cli-deploy/ember-cli-deploy-redis#activecontentsuffix.
The regular expression to check the revision. By default this option will be ^[0-9a-f]{32}$
.
The options for the Redis client. For available options see Redis::Client::DEFAULTS.
If enabled, debug information can be viewed under /debug
. By default this option will be false
.
Run rspec
.
or via Guard:
$ guard -g spec
Run COVERAGE=true rspec
.
Run rubocop
.
To run all specs and RuboCop altogether, run rake
.
$ rackup
$ thin -R config.ru -d start
$ thin stop
GitHub Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems here.
This library aims to adhere to Semantic Versioning 2.0.0. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, that version should be immediately yanked and / or a new version should be immediately released that restores compatibility.
Ember CLI Deploy Rack is released under the MIT License (MIT), see LICENSE.