-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCapfile
More file actions
55 lines (44 loc) · 1.66 KB
/
Capfile
File metadata and controls
55 lines (44 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require "bundler/capistrano"
require 'procodile/capistrano2'
load 'deploy'
load 'deploy/assets'
## The repository from which you wish to deploy your application
## from should be entered here.
set :repository, "git@github.com:darkphnx/elfkit.git"
# General
set :application, "elfkit"
set :domain, "elfk.it"
set :user, "dan"
set :use_sudo, false
set :deploy_to, "/opt/rails/elfkit"
set :repository_cache, "#{application}_cache"
set :environment, "production"
set :assets_role, [:app]
# GIT
set :branch, "master"
set :keep_releases, 3
set :deploy_via, :remote_cache
set :scm, :git
# SSH
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
ssh_options[:paranoid] = true # comment out if it gives you trouble. newest net/ssh needs this set.
role :app, "danw.infra.atech.io"
role :db, "danw.infra.atech.io", :primary => true
set :config_files, ['database.yml', 'secrets.yml']
namespace :deploy do
desc 'Symlink configuration files into new application'
task :symlink_config do
commands = fetch(:config_files, []).map do |file|
"ln -s #{shared_path}/config/#{file} #{release_path}/config/#{file}"
end.join(' && ')
run commands
run "ln -s #{shared_path}/Procfile.local #{release_path}/Procfile.local"
end
desc 'Symlink a shared cache folder'
task :symlink_cache do
run "mkdir -p #{shared_path}/rails-cache && rm -Rf #{release_path}/tmp/cache && ln -s #{shared_path}/rails-cache #{release_path}/tmp/cache"
end
end
before "deploy:assets:symlink", "deploy:symlink_config"
before "deploy:assets:symlink", "deploy:symlink_cache"