Tag: Capistrano
gem install capistrano capistrano_colors
cd ~/myapp capify .
set :application, "set your application name here" set :repository, "set your repository location here" # set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based o\ n known version control directory names # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` role :web, "your web-server here" # Your HTTP server, Apache/etc role :app, "your app-server here" # This may be the same as your `Web` ser\ ver role :db, "your primary db-server here", :primary => true # This is where Rails migrations will ru\ n role :db, "your slave db-server here"
# sshのユーザー名 set :user, "demouser" # ssh公開鍵設定 set :ssh_options, :port=>11111 :forward_agent=>false, :keys=>"~/.ssh/id_rsa_demo", :passphrase => "demopassphrase" # sudoするかどうか(sudoしないほうが普通らしい) set :use_sudo, false # デプロイサーバ定義 role :web, "demohost" # lsコマンド実行タスク task :list do run "ls" end
cap list
set :user, "demouser" # ssh公開鍵設定 set :ssh_options, :port=>11111 :forward_agent=>false, :keys=>"~/.ssh/id_rsa_demo", :passphrase => "demopassphrase" # sudoするかどうか(sudoしないほうが普通らしい) set :use_sudo, false # アプリケーション名 set :application, "demoapp" # scmの指定 set :scm ,:git # gitリポジトリ set :repository, "git@gitserver:demoapp.git" # gitブランチ名 set :branch, :master # デプロイ方式。:copyの場合手元でソースを最新にしてからコピーする。 # :checkoutの場合サーバー上でgitリポジトリに接続して更新するらしい。 set :deploy_via , :copy # deploy先ディレクトリ(サーバーのディレクトリ) set :deploy_to, "/var/www/html/demo" # デプロイサーバ定義 role :web, "demohost" # lsコマンド実行タスク task :list do run "ls" end
cap deploy:setup
cap deploy
# 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')}" en
require "bundler/capistrano" require "capistrano-rbenv" set :rbenv_ruby_version, "1.9.3-p429"