Factorize some code
This commit is contained in:
parent
fda1218a5f
commit
b9c91cbab4
1 changed files with 6 additions and 12 deletions
|
@ -24,29 +24,23 @@ set :forward_agent, true
|
||||||
|
|
||||||
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
|
||||||
# They will be linked in the 'deploy:link_shared_paths' step.
|
# They will be linked in the 'deploy:link_shared_paths' step.
|
||||||
set :shared_dirs, [
|
shared_dirs = [
|
||||||
'log',
|
'log',
|
||||||
'sockets',
|
'sockets',
|
||||||
'tmp/pids',
|
'tmp/pids',
|
||||||
'tmp/cache'
|
'tmp/cache'
|
||||||
]
|
]
|
||||||
|
set :shared_dirs, shared_dirs
|
||||||
|
|
||||||
puts "Deploy to #{ENV.fetch('domain')}, branch: #{ENV.fetch('branch')}"
|
puts "Deploy to #{ENV.fetch('domain')}, branch: #{ENV.fetch('branch')}"
|
||||||
|
|
||||||
# This task is the environment that is loaded for most commands, such as
|
# This task is the environment that is loaded for most commands, such as
|
||||||
# `mina deploy` or `mina rake`.
|
# `mina deploy` or `mina rake`.
|
||||||
task :setup do
|
task :setup do
|
||||||
command %[mkdir -p "#{deploy_to}/shared/log"]
|
shared_dirs.each do |dir|
|
||||||
command %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]
|
command %[mkdir -p "#{deploy_to}/shared/#{dir}"]
|
||||||
|
command %[chmod g+rx,u+rwx "#{deploy_to}/shared/#{dir}"]
|
||||||
command %[mkdir -p "#{deploy_to}/shared/sockets"]
|
end
|
||||||
command %[chmod g+rx,u+rwx "#{deploy_to}/shared/sockets"]
|
|
||||||
|
|
||||||
command %[mkdir -p "#{deploy_to}/shared/tmp/pids"]
|
|
||||||
command %[chmod g+rx,u+rwx "#{deploy_to}/shared/tmp/pids"]
|
|
||||||
|
|
||||||
command %[mkdir -p "#{deploy_to}/shared/tmp/cache"]
|
|
||||||
command %[chmod g+rx,u+rwx "#{deploy_to}/shared/tmp/cache"]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :yarn do
|
namespace :yarn do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue