@@ -23,21 +23,43 @@ You are currently on the Version 2 branch.
23
23
24
24
## Installation
25
25
26
+ Specify your dependencies:
26
27
```
27
28
# Gemfile
28
- gem 'capistrano', '~> 3.10'
29
+ source 'https://rubygems.org'
30
+ gem 'capistrano', '~> 3.11'
29
31
gem 'capistrano-symfony', '~> 2.0.0-alfa1'
30
32
```
31
33
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:
33
41
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
35
48
36
49
```
37
50
# Capfile
38
51
require 'capistrano/symfony'
52
+
53
+ # If you use composer you might want this:
54
+ require 'capistrano/composer'
39
55
```
40
56
57
+ ## Usage
58
+
59
+ ```
60
+ cap staging deploy
61
+ cap production deploy
62
+ ```
41
63
42
64
### Settings
43
65
@@ -53,14 +75,14 @@ to see exactly how the defaults are set up.
53
75
``` ruby
54
76
55
77
# symfony-standard edition directories
78
+ set :bin_path , " bin"
56
79
set :config_path , " config"
57
- set :web_path , " public"
58
80
set :var_path , " var"
59
- set :bin_path , " bin "
81
+ set :web_path , " public "
60
82
61
83
# The next settings are lazily evaluated from the above values, so take care
62
84
# when modifying them
63
- set :log_path , " var/logs "
85
+ set :log_path , " var/log "
64
86
set :cache_path , " var/cache"
65
87
66
88
set :symfony_console_path , " bin/console"
@@ -71,8 +93,10 @@ set :assets_install_path, "public"
71
93
set :assets_install_flags , ' --symlink'
72
94
73
95
# Share files/directories between releases
74
- set :linked_files , []
75
96
set :linked_dirs , [" var/logs" ]
97
+ set :linked_files , []
98
+ # To use a .env file:
99
+ # set :linked_files, [".env"]
76
100
77
101
# Set correct permissions between releases, this is turned off by default
78
102
set :file_permissions_paths , [" var" ]
@@ -81,6 +105,12 @@ set :permission_method, false
81
105
# Role filtering
82
106
set :symfony_roles , :all
83
107
set :symfony_deploy_roles , :all
108
+
109
+ # Add extra environment variables:
110
+ set :default_env , {
111
+ ' APP_ENV' => ' prod'
112
+ ' SECRET' => ' foobar'
113
+ }
84
114
```
85
115
86
116
### Flow
@@ -138,8 +168,12 @@ set :file_permissions_users, ["nginx"]
138
168
set :file_permissions_paths, ["var", "public/uploads"]
139
169
```
140
170
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
+
143
177
144
178
See [ the symfony documentation] ( http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup )
145
179
and [ the file permission capistrano plugin] ( https://github.com/capistrano/file-permissions ) for reference.
@@ -186,6 +220,24 @@ namespace :deploy do
186
220
end
187
221
```
188
222
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
+
189
241
[ 1 ] : http://capistranorb.com/documentation/getting-started/flow/
190
242
[ 2 ] : http://capifony.org/
191
243
[ 3 ] : http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
0 commit comments