capistrano-recipes 0.5.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/LICENSE +1 -1
- data/README.rdoc +73 -6
- data/Rakefile +2 -27
- data/capistrano-recipes.gemspec +21 -44
- data/doc/god/god +1 -0
- data/doc/god/god.conf +102 -0
- data/doc/god/god.init +62 -0
- data/generators/app.god.erb +25 -0
- data/generators/nginx.conf.erb +207 -0
- data/generators/unicorn.rb.erb +62 -0
- data/lib/capistrano_recipes.rb +1 -1
- data/lib/helpers.rb +62 -2
- data/lib/recipes/application.rb +67 -0
- data/lib/recipes/bluepill.rb +53 -0
- data/lib/recipes/bundler.rb +14 -0
- data/lib/recipes/db.rb +65 -5
- data/lib/recipes/deploy.rb +86 -16
- data/lib/recipes/god.rb +125 -0
- data/lib/recipes/hooks.rb +14 -0
- data/lib/recipes/log.rb +4 -4
- data/lib/recipes/nginx.rb +52 -0
- data/lib/recipes/passenger.rb +6 -6
- data/lib/recipes/resque.rb +48 -0
- data/lib/recipes/sphinx.rb +38 -0
- data/lib/recipes/symlinks.rb +27 -0
- data/lib/recipes/unicorn.rb +82 -0
- data/lib/version.rb +3 -0
- metadata +71 -17
- data/VERSION.yml +0 -4
- data/lib/recipes/symlink.rb +0 -51
data/VERSION.yml
DELETED
data/lib/recipes/symlink.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
2
|
-
unless exists?(:config_files)
|
3
|
-
set :config_files, 'database.yml'
|
4
|
-
end
|
5
|
-
|
6
|
-
namespace :symlink do
|
7
|
-
desc <<-DESC
|
8
|
-
Create shared directories. Specify which directories are shared via:
|
9
|
-
set :shared_dirs, %w(avatars videos)
|
10
|
-
DESC
|
11
|
-
task :create_shared_dirs, :roles => :app do
|
12
|
-
shared_dirs.each { |link| run "mkdir -p #{shared_path}/#{link}" } if shared_dirs
|
13
|
-
end
|
14
|
-
|
15
|
-
desc <<-DESC
|
16
|
-
Create links to shared directories from current deployment's public directory.
|
17
|
-
Specify which directories are shared via:
|
18
|
-
set :shared_dirs, %w(avatars videos)
|
19
|
-
DESC
|
20
|
-
task :shared_directories, :roles => :app do
|
21
|
-
shared_dirs.each do |link|
|
22
|
-
run "rm -rf #{release_path}/public/#{link}"
|
23
|
-
run "ln -nfs #{shared_path}/#{link} #{release_path}/public/#{link}"
|
24
|
-
end if shared_dirs
|
25
|
-
end
|
26
|
-
|
27
|
-
desc <<-DESC
|
28
|
-
Create links to config files stored in shared config directory.
|
29
|
-
Specify which config files to link using the following:
|
30
|
-
set :config_files, 'database.yml'
|
31
|
-
DESC
|
32
|
-
task :shared_config_files, :roles => :app do
|
33
|
-
config_files.each do |file_path|
|
34
|
-
begin
|
35
|
-
run "#{sudo} rm #{config_path}#{file_path}"
|
36
|
-
run "#{sudo} ln -nfs #{shared_config_path}#{file_path} #{config_path}#{file_path}"
|
37
|
-
rescue
|
38
|
-
puts "Problem linking to #{file_path}. Be sure file already exists in #{shared_config_path}."
|
39
|
-
end
|
40
|
-
end if config_files
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def config_path
|
45
|
-
"#{current_release}/config/"
|
46
|
-
end
|
47
|
-
|
48
|
-
def shared_config_path
|
49
|
-
"#{shared_path}/config/"
|
50
|
-
end
|
51
|
-
end
|