Sha256: 50c131adea7077b80a5566c701d28d1449cb51452a202057300cae0ab4faa45b
Contents?: true
Size: 835 Bytes
Versions: 1
Compression:
Stored size: 835 Bytes
Contents
namespace :load do task :defaults do set :safe_deploy_to_owner, nil set :safe_deploy_to_path, -> { fetch(:deploy_to) } end end namespace :safe_deploy_to do task :create do on roles :all do sudo :mkdir, '-pv', fetch(:safe_deploy_to_path) end end task ensure_owner: [:create] do on roles :all do unless fetch(:safe_deploy_to_owner) user = capture :id, '-un' group = capture :id, '-gn' set :safe_deploy_to_owner, "#{user}:#{group}" end sudo :chown, fetch(:safe_deploy_to_owner), fetch(:safe_deploy_to_path) end end desc "Ensures deploy_to directory exists and has the right owner" task ensure: [:create, :ensure_owner] end before "deploy:check", "safe_deploy_to:ensure" before "setup", "safe_deploy_to:ensure" if Rake::Task.task_defined?(:setup)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
capistrano-safe-deploy-to-1.1.1 | lib/capistrano/tasks/safe_deploy_to.rake |