|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +set :application, "rubykaigi" |
| 3 | +set :repository, "git://github.com/kakutani/rubykaigi.git" |
| 4 | +set :branch, "master" |
| 5 | + |
| 6 | +# If you aren't deploying to /u/apps/#{application} on the target |
| 7 | +# servers (which is the default), you can specify the actual location |
| 8 | +# via the :deploy_to variable: |
| 9 | +set :deploy_to, "/home/#{application}/railsapp" |
| 10 | +set :ssh_options, { :forward_agent => true } |
| 11 | + |
| 12 | +# If you aren't using Subversion to manage your source code, specify |
| 13 | +# your SCM below: |
| 14 | +set :scm, :git |
| 15 | +set :git_shallow_clone, 1 |
| 16 | + |
| 17 | +set :use_sudo, false |
| 18 | +set :runner, "rubykaigi" |
| 19 | +ssh_options[:username] = application |
| 20 | + |
| 21 | +set :production_server, "regional.rubykaigi.org" |
| 22 | +role :app, production_server |
| 23 | +role :web, production_server |
| 24 | +role :db, production_server, :primary => true |
| 25 | + |
| 26 | +set :rake, "/home/#{application}/bin/rake" |
| 27 | + |
| 28 | +def setup_shared(dir, path) |
| 29 | + src = "#{shared_path}/#{dir}/#{path}" |
| 30 | + dest = "#{latest_release}/#{dir}/#{path}" |
| 31 | + run "! test -e #{dest} && ln -s #{src} #{dest}" |
| 32 | +end |
| 33 | + |
| 34 | +def setup_shared_config(path) |
| 35 | + setup_shared("config", path) |
| 36 | +end |
| 37 | + |
| 38 | +namespace :deploy do |
| 39 | + task :after_update_code do |
| 40 | + setup_shared("db", "production.sqlite3") |
| 41 | + end |
| 42 | + |
| 43 | + desc "resart for our application" |
| 44 | + task :restart, :roles => :app, :except => { :no_release => true } do |t| |
| 45 | + stop |
| 46 | + start |
| 47 | + end |
| 48 | +end |
0 commit comments