Skip to content

Commit

Permalink
Prepare for 2.0.0-alfa1 (#102)
Browse files Browse the repository at this point in the history
* Bugfixes

* Added readme

* Show how to set environment variables

* Use alfa version

* Webpath should be "public"

* Adding changelog
  • Loading branch information
Nyholm authored Sep 10, 2018
1 parent d1b2e22 commit 967717d
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Capistrano Symfony 1.x Changelog


## `2.0.0-alfa1`

Support for only Symfony4.

## `1.0.0`

No changes since RC3
Expand Down
70 changes: 61 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,43 @@ You are currently on the Version 2 branch.

## Installation

Specify your dependencies:
```
# Gemfile
gem 'capistrano', '~> 3.10'
source 'https://rubygems.org'
gem 'capistrano', '~> 3.11'
gem 'capistrano-symfony', '~> 2.0.0-alfa1'
```

## Usage
Install your dependencies:
```
bundle install
```

When `capistrano` and `capistrano-symfony` is installed. Run the following command
to set up your local files:

Require capistrano-symfony in your cap file
```
cap install
```

Make Capistrano aware of `'capistrano/symfony' by require capistrano-symfony in your
new Capfile

```
# Capfile
require 'capistrano/symfony'
# If you use composer you might want this:
require 'capistrano/composer'
```

## Usage

```
cap staging deploy
cap production deploy
```

### Settings

Expand All @@ -53,14 +75,14 @@ to see exactly how the defaults are set up.
```ruby

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

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

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

# Share files/directories between releases
set :linked_files, []
set :linked_dirs, ["var/logs"]
set :linked_files, []
# To use a .env file:
#set :linked_files, [".env"]

# Set correct permissions between releases, this is turned off by default
set :file_permissions_paths, ["var"]
Expand All @@ -81,6 +105,12 @@ set :permission_method, false
# Role filtering
set :symfony_roles, :all
set :symfony_deploy_roles, :all

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

### Flow
Expand Down Expand Up @@ -138,8 +168,12 @@ set :file_permissions_users, ["nginx"]
set :file_permissions_paths, ["var", "public/uploads"]
```

Please note that `:acl` requires that `setfacl` be available on your deployment
target
**Note:** Using `:acl` requires that `setfacl` be available on your deployment target.
**Note:** If you are getting an error like `setfacl: Option -m: Invalid argument near character 3`,
it means that the users in `file_permissions_users` do not exist on your deployment
target.



See [the symfony documentation](http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup)
and [the file permission capistrano plugin](https://github.com/capistrano/file-permissions) for reference.
Expand Down Expand Up @@ -186,6 +220,24 @@ namespace :deploy do
end
```

### Using composer

If you use composer, make sure your Capfile includes:

```
require 'capistrano/composer'
```

To download the composer executable add the following to your `deploy.rb`:

```
# First define deploy target:
set :deploy_to, "/home/sites/com.example"
# Install composer if it does not exist
SSHKit.config.command_map[:composer] = "php #{shared_path.join("composer.phar")}"
```

[1]: http://capistranorb.com/documentation/getting-started/flow/
[2]: http://capifony.org/
[3]: http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
Expand Down
4 changes: 2 additions & 2 deletions capistrano-symfony.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

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

gem.files = `git ls-files`.split($/)
Expand Down
3 changes: 2 additions & 1 deletion lib/capistrano/symfony/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set :bin_path, "bin"
set :config_path, "config"
set :var_path, "var"
set :web_path, "web"
set :web_path, "public"

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

# Role filtering
set :symfony_roles, :all
set :symfony_deploy_roles, :all
6 changes: 5 additions & 1 deletion lib/capistrano/tasks/symfony.rake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ namespace :symfony do

desc "Make symfony_console_path executable"
task :make_console_executable do
execute :chmod, "755", fetch(:symfony_console_path)
on release_roles(fetch(:symfony_deploy_roles)) do
within release_path do
execute :chmod, "755", fetch(:symfony_console_path)
end
end
end
end

Expand Down

0 comments on commit 967717d

Please sign in to comment.