Skip to content

Commit 05d07df

Browse files
committed
capify
1 parent feee492 commit 05d07df

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

Capfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3+
load 'config/deploy'

app/helpers/welcome_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module WelcomeHelper
2+
end

config/deploy.rb

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

script/spin

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
export RUBYLIB=$HOME/lib/ruby
3+
export GEM_HOME=$HOME/gem.repos
4+
export PATH=$GEM_HOME/bin:$HOME/bin:$PATH
5+
$(dirname $0)/process/spawner -p 9100 -i 3

0 commit comments

Comments
 (0)