Created
May 9, 2012 08:51
-
-
Save teohm/2643104 to your computer and use it in GitHub Desktop.
Capistrano - basic setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/deploy/demo.rb | |
# DEMO-specific deployment configuration | |
# please put general deployment config in config/deploy.rb | |
puts "****demo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/deploy.rb | |
set :application, "project2" | |
set :stages, %w(live demo) | |
set :default_stage, "demo" | |
require 'capistrano/ext/multistage' | |
set :repository, "[email protected]:teohm/event-api.git" | |
set :scm, :git | |
set :deploy_via, :remote_cache | |
# Enable SSH agent forwarding | |
ssh_options[:forward_agent] = true | |
# | |
# 1) when error: Host key verification failed | |
# login remote server, run: ssh [email protected], and accept the host as known_hosts | |
# | |
# 2) when error: Permission denied (public_key) | |
# run 'ssh-add -K' on local machine, to add your key to ssh forward agent | |
# $ ssh-add -K | |
# Identity added: /Users/huiming/.ssh/id_rsa (/Users/huiming/.ssh/id_rsa) | |
# | |
# What is SSH Agent Forwarding? | |
# http://www.unixwiz.net/techtips/ssh-agent-forwarding.html | |
# (it's a bit long, but worth reading) | |
# | |
server "learndeploy", :web, :app, :db, :primary => true | |
set :deploy_to, "/home/deployer/#{application}" | |
set :use_sudo, false | |
puts "end of deploy" | |
require 'capistrano/shared_file' # gem install capistrano-shared_file | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/deploy/live.rb | |
# LIVE-specific deployment configuration | |
# please put general deployment config in config/deploy.rb | |
puts "***live" | |
server "learndeploy", :web, :app, :db, :primary => true | |
set :deploy_to, "/home/deployer/#{application}-live" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment