Skip to content

Commit 967717d

Browse files
authored
Prepare for 2.0.0-alfa1 (#102)
* Bugfixes * Added readme * Show how to set environment variables * Use alfa version * Webpath should be "public" * Adding changelog
1 parent d1b2e22 commit 967717d

File tree

5 files changed

+74
-13
lines changed

5 files changed

+74
-13
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Capistrano Symfony 1.x Changelog
22

33

4+
## `2.0.0-alfa1`
5+
6+
Support for only Symfony4.
7+
48
## `1.0.0`
59

610
No changes since RC3

README.md

+61-9
Original file line numberDiff line numberDiff line change
@@ -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'
2931
gem '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
3851
require '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"
5679
set :config_path, "config"
57-
set :web_path, "public"
5880
set :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"
6486
set :cache_path, "var/cache"
6587

6688
set :symfony_console_path, "bin/console"
@@ -71,8 +93,10 @@ set :assets_install_path, "public"
7193
set :assets_install_flags, '--symlink'
7294

7395
# Share files/directories between releases
74-
set :linked_files, []
7596
set :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
78102
set :file_permissions_paths, ["var"]
@@ -81,6 +105,12 @@ set :permission_method, false
81105
# Role filtering
82106
set :symfony_roles, :all
83107
set :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"]
138168
set :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

144178
See [the symfony documentation](http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup)
145179
and [the file permission capistrano plugin](https://github.com/capistrano/file-permissions) for reference.
@@ -186,6 +220,24 @@ namespace :deploy do
186220
end
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

capistrano-symfony.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
44

55
Gem::Specification.new do |gem|
66
gem.name = "capistrano-symfony"
7-
gem.version = '1.0.0'
7+
gem.version = '2.0.0-alfa1'
88
gem.authors = ["Peter Mitchell"]
99
gem.email = ["[email protected]"]
1010
gem.description = %q{Symfony specific Capistrano tasks}
11-
gem.summary = %q{Capistrano Symfony - Easy deployment of Symfony 2 & 3 apps with Ruby over SSH}
11+
gem.summary = %q{Capistrano Symfony - Easy deployment of Symfony 4 apps with Ruby over SSH}
1212
gem.homepage = "http://github.com/capistrano/capistrano-symfony"
1313

1414
gem.files = `git ls-files`.split($/)

lib/capistrano/symfony/defaults.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set :bin_path, "bin"
88
set :config_path, "config"
99
set :var_path, "var"
10-
set :web_path, "web"
10+
set :web_path, "public"
1111

1212
# Use closures for directories nested under the top level dirs, so that
1313
# any changes to web/app etc do not require these to be changed also
@@ -37,3 +37,4 @@
3737

3838
# Role filtering
3939
set :symfony_roles, :all
40+
set :symfony_deploy_roles, :all

lib/capistrano/tasks/symfony.rake

+5-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ namespace :symfony do
6666

6767
desc "Make symfony_console_path executable"
6868
task :make_console_executable do
69-
execute :chmod, "755", fetch(:symfony_console_path)
69+
on release_roles(fetch(:symfony_deploy_roles)) do
70+
within release_path do
71+
execute :chmod, "755", fetch(:symfony_console_path)
72+
end
73+
end
7074
end
7175
end
7276

0 commit comments

Comments
 (0)