Skip to content

Instantly share code, notes, and snippets.

@koseki
Created April 23, 2010 13:50
Show Gist options
  • Save koseki/376556 to your computer and use it in GitHub Desktop.
Save koseki/376556 to your computer and use it in GitHub Desktop.
Capistrano Minimal
Dir.chdir(File.dirname(__FILE__))
# load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
require 'capistrano/ext/multistage'
set :default_stage, "staging"
namespace :deploy do
desc "デプロイを実行します。"
task :default do
svn.update
end
end
namespace :svn do
desc "svn updateを実行します。"
task :update do
run "svn update #{deploy_to}"
end
desc "svn diffを実行します。"
task :diff do
run "svn diff #{deploy_to}"
end
desc "svn status -uを実行します。"
task :status do
run "svn status -u #{deploy_to}"
end
end
set :domain, "live.example.com"
set :user, "example" # sshログインユーザ名
set :deploy_to, "/home/#{user}/path/to/deploy"
role :app, "#{domain}"
# ssh踏み台サーバ
# set :gateway, "gateway.example.com"
# set :gateway, "[email protected]"
puts <<'EOT'
--------------------------------------------------------------------------------
_ _ _
__/\__ | (_)_ _____| | __/\__
\ / | | \ \ / / _ \ | \ /
/_ _\ | | |\ V / __/_| /_ _\
\/ |_|_| \_/ \___(_) \/
your app name
--------------------------------------------------------------------------------
EOT
set :domain, "staging.example.com"
set :user, "example" # sshログインユーザ名
set :deploy_to, "/home/#{user}/path/to/deploy"
role :app, "#{domain}"
# ssh踏み台サーバ
# set :gateway, "gateway.example.com"
# set :gateway, "[email protected]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment