lib/capistrano/tasks/laravel.rake in capistrano-laravel-1.1.0 vs lib/capistrano/tasks/laravel.rake in capistrano-laravel-1.1.1
- old
+ new
@@ -96,10 +96,11 @@
end
end
desc 'Determine which paths, if any, to have ACL permissions set.'
task :resolve_acl_paths do
+ next unless fetch(:laravel_set_acl_paths)
laravel_version = fetch(:laravel_version)
# Use Laravel 5 ACL paths by default
laravel_acl_paths = fetch(:laravel_5_acl_paths)
if laravel_version < 5 # Laravel 4
@@ -123,11 +124,11 @@
end
end
desc 'Ensure that ACL paths exist.'
task :ensure_acl_paths_exist do
- next unless fetch(:laravel_ensure_acl_paths_exist)
+ next unless fetch(:laravel_set_acl_paths) && fetch(:laravel_ensure_acl_paths_exist)
on roles fetch(:laravel_roles) do
fetch(:file_permissions_paths).each do |path|
within release_path do
execute :mkdir, '-p', path
@@ -186,11 +187,11 @@
Rake::Task['laravel:artisan'].invoke(:optimize, '--force')
end
desc 'Create a symbolic link from "public/storage" to "storage/app/public."'
task :storage_link do
- next if fetch(:laravel_version) <= 5.3
+ next if fetch(:laravel_version) < 5.3
Rake::Task['laravel:artisan'].invoke('storage:link')
end
desc 'Run the database migrations.'
task :migrate do
@@ -219,17 +220,13 @@
set(:laravel_roles, laravel_roles)
set(:laravel_artisan_flags, laravel_artisan_flags)
end
before 'deploy:starting', 'laravel:resolve_linked_dirs'
+ before 'deploy:starting', 'laravel:resolve_acl_paths'
after 'deploy:starting', 'laravel:ensure_linked_dirs_exist'
+ after 'deploy:updating', 'laravel:ensure_acl_paths_exist'
+ before 'deploy:updated', 'deploy:set_permissions:acl'
before 'composer:run', 'laravel:upload_dotenv_file'
after 'composer:run', 'laravel:storage_link'
after 'composer:run', 'laravel:optimize'
-
- # Only include ACL tasks if enabled
- if fetch(:laravel_set_acl_paths)
- before 'deploy:starting', 'laravel:resolve_acl_paths'
- before 'deploy:set_permissions:acl', 'laravel:ensure_acl_paths_exist'
- before 'deploy:publishing', 'deploy:set_permissions:acl'
- end
end