Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix capistrano config for symfony 4
  • Loading branch information
loic425 committed Oct 16, 2018
1 parent 71146d5 commit fc20040
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Gemfile
@@ -1,4 +1,4 @@
source 'https://rubygems.org'
gem 'capistrano'
gem 'capistrano-symfony', '~> 1.0.0.rc1'
gem 'capistrano-file-permissions', :git => 'https://github.com/capistrano/file-permissions', :ref => '0122fe4'
gem 'capistrano-symfony', '~> 2.0.0-alfa2'
gem 'capistrano-file-permissions'
30 changes: 13 additions & 17 deletions Gemfile.lock
@@ -1,33 +1,29 @@
GIT
remote: https://github.com/capistrano/file-permissions
revision: 0122fe4ab1e36e0608cca7f41a2401b293d8f456
ref: 0122fe4
specs:
capistrano-file-permissions (1.0.0)
capistrano (~> 3.0)

GEM
remote: https://rubygems.org/
specs:
airbrussh (1.2.0)
airbrussh (1.3.0)
sshkit (>= 1.6.1, != 1.7.0)
capistrano (3.8.0)
capistrano (3.11.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-composer (0.0.6)
capistrano (>= 3.0.0.pre)
capistrano-symfony (1.0.0.rc2)
capistrano-file-permissions (1.0.0)
capistrano (~> 3.0)
capistrano-symfony (2.0.0.pre.alfa2)
capistrano (~> 3.1)
capistrano-composer (~> 0.0.3)
capistrano-file-permissions (~> 1.0)
i18n (0.8.1)
concurrent-ruby (1.0.5)
i18n (1.1.1)
concurrent-ruby (~> 1.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.1.0)
rake (12.0.0)
sshkit (1.13.1)
net-ssh (5.0.2)
rake (12.3.1)
sshkit (1.17.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)

Expand All @@ -36,8 +32,8 @@ PLATFORMS

DEPENDENCIES
capistrano
capistrano-file-permissions!
capistrano-symfony (~> 1.0.0.rc1)
capistrano-file-permissions
capistrano-symfony (~> 2.0.0.pre.alfa2)

BUNDLED WITH
1.14.6
9 changes: 5 additions & 4 deletions config/packages/liip_imagine.yaml
@@ -1,10 +1,11 @@
# @see http://symfony.com/doc/current/bundles/LiipImagineBundle/index.html
liip_imagine:
resolvers:
loaders:
default:
web_path:
web_root: "%kernel.project_dir%/public"
cache_prefix: "media/cache"
filesystem:
data_root:
- "%kernel.project_dir%/public"
- "/home/jedisjeux/shared/public"
filter_sets:
# @see http://symfony.com/doc/current/bundles/LiipImagineBundle/filters.html
cache: ~
Expand Down
29 changes: 18 additions & 11 deletions etc/capistrano/deploy.rb
@@ -1,19 +1,18 @@
# config valid only for current version of Capistrano
lock '3.8.0'
lock '3.11.0'

set :symfony_directory_structure, 3
set :sensio_distribution_version, 5

# symfony-standard edition directories
set :app_path, "app"
set :web_path, "web"
set :config_path, "config"
set :web_path, "public"
set :var_path, "var"
set :bin_path, "bin"

# The next 3 settings are lazily evaluated from the above values, so take care
# when modifying them
set :app_config_path, "app/config"
set :log_path, "var/logs"
set :log_path, "var/log"
set :cache_path, "var/cache"

set :symfony_console_path, "bin/console"
Expand All @@ -23,12 +22,12 @@
set :controllers_to_clear, ["app_*.php"]

# asset management
set :assets_install_path, "web"
set :assets_install_path, "public"
set :assets_install_flags, '--symlink'

# Share files/directories between releases
set :linked_files, ["web/jedisjeux.xml"]
set :linked_dirs, ["var/logs", "var/sessions", "web/uploads", "web/media"]
set :linked_dirs, ["var/log", "var/sessions", "public/uploads", "public/media"]

set :application, 'Jedisjeux'
set :repo_url, 'https://github.com/Jedisjeux/Jedisjeux.git'
Expand All @@ -50,18 +49,24 @@
# Default value for :pty is false
set :pty, true

append :linked_files, fetch(:app_config_path) + '/parameters.yml', fetch(:web_path) + '/robots.txt', fetch(:web_path) + '/.htaccess'
append :linked_dirs, fetch(:web_path) + '/uploaded', fetch(:web_path) + '/uploads', fetch(:web_path) + '/media'
append :linked_files, fetch(:web_path) + '/robots.txt'
append :linked_dirs, fetch(:web_path) + '/uploads', fetch(:web_path) + '/media'

append :file_permissions_users, 'apache'
set :file_permissions_paths, ["var", "web/uploads"]
set :file_permissions_paths, ["var", "public/uploads"]
set :file_permissions_users, ["jedisjeux"]

set :permission_method, :acl
set :use_set_permissions, true

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Add extra environment variables:
# set :default_env, {
# 'APP_ENV' => 'prod',
# 'APP_SECRET' => 'foobar'
# }

set :keep_releases, 3

namespace :deploy do
Expand All @@ -83,6 +88,8 @@
end
end

before "deploy:updated", "deploy:set_permissions:acl"

after 'deploy:updated', :build_assets do
on roles(:web) do
puts "Build assets"
Expand Down

0 comments on commit fc20040

Please sign in to comment.