lib/ms_deploy/recipes/setup.rb in ms_deploy-0.3.5 vs lib/ms_deploy/recipes/setup.rb in ms_deploy-0.3.6
- old
+ new
@@ -12,10 +12,14 @@
desc "Set up shared directory structure"
task :create_shared_folders, :roles => :app do
directories_to_create.each { |directory| run "mkdir -p #{directory}" }
end
+ task :set_permissions, :roles => :app do
+ try_sudo "chown -R #{user}:#{fetch(:group, user)} #{deploy_to}" if fetch(:use_sudo, false)
+ end
+
task :database, :roles => :db do
_cset :db_admin_user, 'root'
_cset :db_admin_password, Capistrano::CLI.password_prompt("Type your mysql password for user '#{db_admin_user}' (not set if empty): ")
_cset :db_name, application.gsub(/\W+/, '')[0..5] + '_' + rails_env.to_s
_cset :db_user_name, application
@@ -32,9 +36,10 @@
end
before 'deploy:setup', 'deploy:prepare:database';
before :'deploy:setup', :'deploy:prepare:create_config_files';
before :'deploy:setup', :'deploy:prepare:create_shared_folders';
+ after 'deploy:setup', 'deploy:prepare:set_permissions';
end
def config_file_path(config_file_name)
config_file = "#{rails_root}/config/#{config_file_name}"