Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

deployment on EC2

  • Loading branch information...
commit a1448cc1fa9fcb57351f983cadfc35e2aab3eb5b 1 parent 5f7a912
@gitfly gitfly authored
Showing with 45 additions and 0 deletions.
  1. +4 −0 Capfile
  2. +4 −0 Gemfile
  3. +37 −0 config/deploy.rb
View
4 Capfile
@@ -0,0 +1,4 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
4 Gemfile
@@ -30,6 +30,10 @@ gem 'mini_magick'
gem 'carrierwave'
gem 'client_side_validations', '~> 3.1.0'
+#production environment
+gem 'execjs'
+gem 'therubyracer'
+
group :development, :test do
gem 'cucumber-rails'
gem 'capybara', '~> 1.0.0'
View
37 config/deploy.rb
@@ -0,0 +1,37 @@
+require "bundler/capistrano"
+
+set :application, "angelnvc.com"
+set :repository, "git@github.com:fredwu/angel_nest.git"
+
+set :scm, "git"
+# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
+
+ssh_options[:forward_agent] = true
+ssh_options[:keys] = [File.join(ENV["HOME"],"xiaoningec2key.pem")]
+set :user, "ubuntu"
+set :branch, "master"
+set :deploy_via, :remote_cache
+
+set :deploy_to, "/var/www"
+
+role :web, "angelnvc.com" # Your HTTP server, Apache/etc
+role :app, "angelnvc.com" # This may be the same as your `Web` server
+role :db, "angelnvc.com", :primary => true # This is where Rails migrations will run
+#role :db, "your slave db-server here"
+
+# if you're still using the script/reaper helper you will need
+# these http://github.com/rails/irs_process_scripts
+
+# If you are using Passenger mod_rails uncomment this:
+ namespace :deploy do
+ task :start do ; end
+ task :stop do ; end
+ task :restart, :roles => :app, :except => { :no_release => true } do
+ run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
+ end
+ end
+
+#RVM plugin, allow cap to find bundler etc in path
+$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
+require "rvm/capistrano" # Load RVM's capistrano plugin.
+#set :rvm_ruby_string, 'rvm@rails3' # Or whatever env you want it to run in.
Please sign in to comment.
Something went wrong with that request. Please try again.