Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some handy tasks and config defaults
- Loading branch information
1 parent
374b85b
commit 6ad6e06
Showing
4 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'rubygems' | ||
require 'railsless-deploy' | ||
load 'config/lib/misc' | ||
load 'config/lib/tasks' | ||
load 'config/deploy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
# Pull in the config file | ||
loadFile 'config/config.rb' | ||
# | ||
set :user, "deploy" | ||
set :use_sudo, false | ||
set :deploy_via, :remote_cache | ||
set :copy_exclude, [".git", ".gitmodules", ".DS_Store", ".gitignore"] | ||
set :keep_releases, 5 | ||
|
||
after "deploy:restart", "deploy:cleanup" | ||
after "deploy:update_code", "shared:make_shared_dir" | ||
after "deploy:update_code", "shared:make_symlinks" | ||
|
||
# Pull in the config file | ||
loadFile 'config/config.rb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace :shared do | ||
task :make_shared_dir do | ||
run "if [ ! -d #{shared_path}/files ]; then mkdir #{shared_path}/files; fi" | ||
end | ||
task :make_symlinks do | ||
run "if [ ! -h #{release_path}/shared ]; then ln -s #{shared_path}/files/ #{release_path}/shared; fi" | ||
run "for p in `find -L #{release_path} -type l`; do t=`readlink $p | grep -o 'shared/.*$'`; sudo mkdir -p #{release_path}/$t; sudo chown www-data:www-data #{release_path}/$t; done" | ||
end | ||
end | ||
|
||
namespace :nginx do | ||
desc "Restarts nginx" | ||
task :restart do | ||
run "sudo /etc/init.d/nginx restart" | ||
end | ||
end | ||
|
||
namespace :phpfpm do | ||
desc" Restarts PHP-FPM" | ||
task :restart do | ||
run "sudo /etc/init.d/php-fpm restart" | ||
end | ||
end | ||
|
||
namespace :git do | ||
desc "Updates git submodule tags" | ||
task :submodule_tags do | ||
run "if [ -d #{shared_path}/cached-copy/ ]; then cd #{shared_path}/cached-copy/ && git submodule foreach --recursive git fetch origin --tags; fi" | ||
end | ||
end |