Skip to content

Instantly share code, notes, and snippets.

@ytkhs
Created October 2, 2012 03:41
Show Gist options
  • Save ytkhs/3816020 to your computer and use it in GitHub Desktop.
Save ytkhs/3816020 to your computer and use it in GitHub Desktop.
sample capistrano for cakephp project
require "bundler/capistrano"
require "capistrano/ext/multistage"
require "capistrano_colors"
require "railsless-deploy"
require "capcake"
set :stages, %w(production staging private)
set :default_stage, "private"
set :use_sudo, false
set :application, "test_app"
set :deploy_to, "/var/hoge/www/#{application}"
set :deploy_via, :copy # copy or checkout or export or remote_cache
set :keep_releases, 1 # for deploy:cleanup
set :current_dir, "htdocs" # DocumentRoot name
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :repository, "git://github.com/fuelphp/fuelphp.git"
set :branch, "master"
set :normalize_asset_timestamps, false # if your app is RoR, switch true.
# Security
set :user do Capistrano::CLI.ui.ask('SSH User: ') end
set :password do Capistrano::CLI.password_prompt('SSH Password: ') end
# ssh_options[:keys] = "/path/to/key" # private key
# ssh_options[:port] = 22 # ssh port
# no need
namespace(:deploy) do
[
:restart, :start, :stop, :cold, :migrate, :migrations,
].each {|t| task(t){ puts "この機能は無効になっています"} }
end
# sample task
task :monitor, :roles => :web do
run "uptime"
run "df -h"
end
task :postprocess do
run "uptime"
end
after "deploy", "postprocess"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment