Skip to content

Commit 99dc93e

Browse files
committed
Preparing for deploy.
1 parent 2f5397a commit 99dc93e

File tree

11 files changed

+37
-0
lines changed

11 files changed

+37
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/config/deploy_private.rb
12
/config/settings.yml
23
/config/redis/development.conf
34
/config/redis/test.conf

Capfile

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

config/deploy.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# after "deploy:update_code", "deploy:set_permissions"
2+
after "deploy:update_code", "deploy:symlink_configs"
3+
4+
namespace :deploy do
5+
desc "Start the app"
6+
task :start, :roles => :app do
7+
sudo "a2ensite #{vhost}"
8+
sudo "/etc/init.d/apache2 reload"
9+
end
10+
11+
desc "Stop the app"
12+
task :stop, :roles => :app do
13+
sudo "a2dissite #{vhost}"
14+
sudo "/etc/init.d/apache2 reload"
15+
end
16+
17+
desc "Restart the app"
18+
task :restart, :roles => :app do
19+
run "touch #{current_path}/tmp/restart.txt"
20+
end
21+
22+
task :set_permissions, :roles => :app do
23+
run "chmod -R o+w #{release_path}/public"
24+
end
25+
26+
desc "Symlink config files"
27+
task :symlink_configs, :roles => :app, :except => { :no_symlink => true } do
28+
%w(settings).each do |filename|
29+
run "ln -nfs #{shared_path}/config/#{filename}.yml #{release_path}/config/#{filename}.yml"
30+
end
31+
end
32+
end
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)