Symfony User Group Romandie


  1. About the group
  2. Capifony
  3. Feedback from SUGZH
  4. Catering

About the group

Symfony enthousiasts meeting in Romandie once a month for light talks about the framework eco-system.

Suggestions ...

  • Format
  • Location
  • Frequency
  • Kind of talks
  • Hackathon
  • Barbecue ?

Every last Thusday of the month ?


Deployement made easy

Capistrano for symfony projects

$ cap deploy


  • Deployment framework for web applications
    • Ruby On Rails applications
    • PHP applications
  • Written in Ruby


  • Automatic deployement
  • Rollback
  • Execute command (local/remote)
  • Multi-stage (with extension)


  • Locally
    • Ruby and GEM installed
    • VCS (Git, Subversion, Mercurial)
  • On the server
    • SSH
    • Right to execute binaries (git, cp, ln)
    • VCS (Git, Subversion, Mercurial)

Deployement strategy

Nice to have

  # ~/.ssh/config
  host lsnn
    hostname lsnn.ch
    user mfh
    protocol 2
    ForwardAgent yes

Remote file structure

 |-- current -> ./releases/20130311184017
 |-- releases
 |   |-- 20130301152536
 |   |-- 20130311180450
 |   `-- 20130311184017
 `-- shared
     |-- app
     |   |-- config
     |       `-- parameters.yml
     |-- app
     |   |-- logs
     |       `-- production.log
     `-- web
         `-- uploads

Capifony Demo

Setup your Symfony project

$ cd my/symfony/project
$ capifony .
[add] writing './Capfile'
[add] writing './app/config/deploy.rb'
[done] symfony 2 project capifonied!

$ edit app/config/deploy.rb


# ./capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator

require 'capifony_symfony2'
load 'app/config/deploy'


set :application, "mysite"
set :domain,      "mysite.ch"
set :deploy_to,   "/srv/www/mysite.ch/"
set :app_path,    "app"

set :user,        "sshuser"
set :use_sudo,    false

set :repository,  "git@github.com:username/repository.git"
set :scm,         :git

./app/config/deploy.rb next

# directories that will be shared between all deployments
set :shared_children,     ["app/logs", "web/uploads", "data"]

# share our database configuration
set :shared_files,      ["app/config/parameters.yml"]

set :model_manager, "doctrine"
role :web,        domain                    # Your HTTP server, Apache/etc
role :app,        domain, :primary => true

set  :keep_releases,  3

./app/config/deploy.rb next

set :use_composer, true

set :update_assets_version, false
set :dump_assetic_assets, true

set :model_manager, "doctrine"    # Or: `propel`

set :app_config_file, "parameters.yml"


$ cap -T
cap database:dump:local       # Dumps local database
cap database:dump:remote      # Dumps remote database
cap database:move:to_local    # Dumps remote database, download...
cap database:move:to_remote   # Dumps local database, loads it ...
cap deploy                    # Deploys your project.
cap deploy:check              # Test deployment dependencies.


$ cap deploy:setup


$ cap deploy


# app/config/deploy.rb
after "deploy", "deploy:cleanup"
before "deploy:migrations", "database:dump:remote"


$ cap deploy:rollback

Useful tasks

# If you need to deploy and run your migrations you can call:
$ cap deploy:migrations

# To run your test suite on the production server, just invoke:
$ cap deploy:testall

# You can invoke tasks/commands by calling:
$ cap symfony

# If you want to see all available tasks, you can run:
$ cap -vT


Feedback from Symfony User Group Zurich

Elastic Search with PHP