@@ -23,21 +23,43 @@ You are currently on the Version 2 branch.
2323
2424## Installation
2525
26+ Specify your dependencies:
2627```
2728# Gemfile
28- gem 'capistrano', '~> 3.10'
29+ source 'https://rubygems.org'
30+ gem 'capistrano', '~> 3.11'
2931gem 'capistrano-symfony', '~> 2.0.0-alfa1'
3032```
3133
32- ## Usage
34+ Install your dependencies:
35+ ```
36+ bundle install
37+ ```
38+
39+ When ` capistrano ` and ` capistrano-symfony ` is installed. Run the following command
40+ to set up your local files:
3341
34- Require capistrano-symfony in your cap file
42+ ```
43+ cap install
44+ ```
45+
46+ Make Capistrano aware of `'capistrano/symfony' by require capistrano-symfony in your
47+ new Capfile
3548
3649```
3750# Capfile
3851require 'capistrano/symfony'
52+
53+ # If you use composer you might want this:
54+ require 'capistrano/composer'
3955```
4056
57+ ## Usage
58+
59+ ```
60+ cap staging deploy
61+ cap production deploy
62+ ```
4163
4264### Settings
4365
@@ -53,14 +75,14 @@ to see exactly how the defaults are set up.
5375``` ruby
5476
5577# symfony-standard edition directories
78+ set :bin_path , " bin"
5679set :config_path , " config"
57- set :web_path , " public"
5880set :var_path , " var"
59- set :bin_path , " bin "
81+ set :web_path , " public "
6082
6183# The next settings are lazily evaluated from the above values, so take care
6284# when modifying them
63- set :log_path , " var/logs "
85+ set :log_path , " var/log "
6486set :cache_path , " var/cache"
6587
6688set :symfony_console_path , " bin/console"
@@ -71,8 +93,10 @@ set :assets_install_path, "public"
7193set :assets_install_flags , ' --symlink'
7294
7395# Share files/directories between releases
74- set :linked_files , []
7596set :linked_dirs , [" var/logs" ]
97+ set :linked_files , []
98+ # To use a .env file:
99+ # set :linked_files, [".env"]
76100
77101# Set correct permissions between releases, this is turned off by default
78102set :file_permissions_paths , [" var" ]
@@ -81,6 +105,12 @@ set :permission_method, false
81105# Role filtering
82106set :symfony_roles , :all
83107set :symfony_deploy_roles , :all
108+
109+ # Add extra environment variables:
110+ set :default_env , {
111+ ' APP_ENV' => ' prod'
112+ ' SECRET' => ' foobar'
113+ }
84114```
85115
86116### Flow
@@ -138,8 +168,12 @@ set :file_permissions_users, ["nginx"]
138168set :file_permissions_paths, ["var", "public/uploads"]
139169```
140170
141- Please note that ` :acl ` requires that ` setfacl ` be available on your deployment
142- target
171+ ** Note:** Using ` :acl ` requires that ` setfacl ` be available on your deployment target.
172+ ** Note:** If you are getting an error like ` setfacl: Option -m: Invalid argument near character 3 ` ,
173+ it means that the users in ` file_permissions_users ` do not exist on your deployment
174+ target.
175+
176+
143177
144178See [ the symfony documentation] ( http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup )
145179and [ the file permission capistrano plugin] ( https://github.com/capistrano/file-permissions ) for reference.
@@ -186,6 +220,24 @@ namespace :deploy do
186220end
187221```
188222
223+ ### Using composer
224+
225+ If you use composer, make sure your Capfile includes:
226+
227+ ```
228+ require 'capistrano/composer'
229+ ```
230+
231+ To download the composer executable add the following to your ` deploy.rb ` :
232+
233+ ```
234+ # First define deploy target:
235+ set :deploy_to, "/home/sites/com.example"
236+
237+ # Install composer if it does not exist
238+ SSHKit.config.command_map[:composer] = "php #{shared_path.join("composer.phar")}"
239+ ```
240+
189241[ 1 ] : http://capistranorb.com/documentation/getting-started/flow/
190242[ 2 ] : http://capifony.org/
191243[ 3 ] : http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
0 commit comments