-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbefore_symlink.rb
40 lines (33 loc) · 1.13 KB
/
before_symlink.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
current_release = release_path
node[:deploy].each do |application, deploy|
execute "php bin/vendors update" do
user "deploy"
cwd current_release
command "php bin/vendors update"
action :run
end
execute "clearing the symfony app cache" do
user "deploy"
cwd current_release
command "php app/console cache:clear --env=scalarium"
action :run
end
execute "execute db migrations" do
user "deploy"
cwd current_release
command "php app/console doctrine:migrations:migrate --no-interaction --env=scalarium"
action :run
end
execute "installing assets" do
user "deploy"
cwd current_release
command "php app/console assets:install web --env=scalarium"
action :run
end
execute "chown app cache and log dirs to deploy:www-data" do
user "root"
cwd current_release
command "mkdir -p app/cache; chown -R deploy:www-data app/cache; chown -R deploy:www-data app/logs; find app/cache -type d | xargs -r chmod 0770; find app/cache -type f | xargs -r chmod 0660; find app/logs -type d | xargs -r chmod 0770; find app/logs -type f | xargs -r chmod 0660;"
action :run
end
end