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.
@@ -1,4 +0,0 @@
1
- ---
2
- :patch: 0
3
- :major: 0
4
- :minor: 5
@@ -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