Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


activelamp_symfony (1) Versions 0.0.1

Cookbook for deploying Symfony2 projects.

cookbook 'activelamp_symfony', '~> 0.0.1', :supermarket
cookbook 'activelamp_symfony', '~> 0.0.1'
knife supermarket install activelamp_symfony
knife supermarket download activelamp_symfony
Quality 17%

Build Status


This cookbook provides an easy way to deploy a Symfony2 application, as well as run console commands on it.


  • activelamp_composer cookbook

You might also need to install this on your node(s):

  • acl package to support the use of Chef::Provider::SymfonyPermission::Setfacl. You might have to use this if your nodes does not support the chmod +a ... command. You can install this using your platform's package manager (.i.e., apt)

Installing PHP and other packages is outside the scope of this cookbook.


  • Tested on Ubuntu/Debian only, but the deploy actions should work with any platform. However, there is no provider to handle :set_permissions on Windows at the moment.



Resources / Providers


This resource simply extends the built-in deploy resource, but provides sensible defaults that are relevant to most Symfony projects. For example, a symlink is automatically created for app/logs into the shared folder so that they persist between deploys. web/uploads is also automatically symlinked. You can override these links by specifying the shared_dirs option in the resource.


  • All actions supported by the deploy resource.
  • :set_permissions - Sets the permissions of app/logs, app/cache, web/uploads and any other directories you specified under world_writable_dirs


#Deploy a Symfony project
symfony_project "/path/to/project" do
    repo ''
    revision 'v1.2'
    git_ssh_wrapper '/tmp/'
    action [:deploy, :set_permissions]
        :dev => true,
        :quiet => false,
        :verbosity => 2
        :database_user => 'root',
        :database_password => node[:mysql][:server_root_password]


All options for the deploy resource is applicable here. However here are additional options that are symfony_project-specific:

Name Default Description
shared_dirs {'logs' => 'app/logs','cache' => 'app/cache','uploads' => 'web/media/uploads','vendor' => 'vendor'} The directories to create under the shared directory and symlinked into every deployment.
world_writable_dirs ['app/logs', 'app/cache', 'web/uploads'] Directories that should be world writeable.
permission_provider Chef::Provider::SymfonyPermission::Chmod The provider that handles the setting of the appropriate permissions on the directories listed under world_writable_dirs. Only relevant on :set_permissions. You can also substitute this for Chef::Provider::SymfonyPermission::Setfacl if your prefer to use setfacl to set the permissions.
web_user "www-data" The user to whom permission will be granted/umasked. Only relevant on :set_permissions
parameters {} Parameters overrides.
parameters_file app/config/parameters.yml Path to the parameters file
parameters_dist_file app/config/parameters.yml.dist Path to the parameters file distributable.
parameters_file_template parameters.yml.erb The ERB template for the parameters file. Parameter overriding is disabled if this is set to nil.
parameters_file_template_cookbook nil The cookbook where the prefered template is located. This will default to the current cookbook. Specify :activelamp_symfony if you wish to use the built-in one. Use @parameters to access the container parameters which are merged from the contents of the distributable and the values in parameters.
composer_options { :action => [:download_phar, :install], :lock_file_only => true, :dev => false, :prefer_dist => true, :prefer_source => false, :optimize_autoloader => true} The options used when the composer resource is called internally during migrate. Refer to the activelamp_composer cookbook for available options.


You can use this resource to interact with your Symfony application via the Symfony Console.


  • :run (default) - Runs the command
  • :nothing


#Run a Symfony Console command
app_console "/path/to/project/current" do
    command 'assetic:dump --force'
    environment 'prod'
    quiet false
    verbosity 3
    user node[:user]
    group node[:group]


Attribute Default Description
app The name attribute The project root of the Symfony application.
command nil The command to execute
environment :prod The environment to run the command in. Used in the --env flag
quiet true If true, adds the --quiet flag
verbosity 1 Value for the --verbose flag.
user nil The user to execute the command as.
group nil The group to execute the command as.
console php app/console The Symfony Console command to use.

An example on using symfony_project and app_console together during deploys:

symfony_project "/path/to/project" do
    repo ''
    revision 'v1.2'
    git_ssh_wrapper '/tmp/'
        :database_user => 'root',
        :database_password => node[:mysql][:server_root_password],
        :database_host => 'localhost'
    user node[:deploy_user]
    group node[:deploy_group]
    permission_provider Chef::Provider::SymfonyPermission::Setfacl
    action [:deploy, :set_permissions]
    notifies :run, 'app_console[assetic-dump]'

app_console "assetic-dump" doo
   app '/path/to/project/current'
   command 'assetic:dump --force'
   console 'php bin/console' # If you are using Symfony 3.0 directory structure.
   user node[:deploy_user]
   group node[:deploy_group]
   action :nothing

License and Authors

Author: Bez Hermoso

Author: ActiveLAMP

Copyright: 2012-2014, ActiveLAMP

Apache 2.0 License

Dependent cookbooks

activelamp_composer ~> 0.0.1

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric

0.0.1 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

0.0.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

0.0.1 failed this metric

FC064: Ensure issues_url is set in metadata: activelamp_symfony/metadata.rb:1
FC065: Ensure source_url is set in metadata: activelamp_symfony/metadata.rb:1
FC066: Ensure chef_version is set in metadata: activelamp_symfony/metadata.rb:1
FC069: Ensure standardized license defined in metadata: activelamp_symfony/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric

0.0.1 passed this metric

Testing File Metric

0.0.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

0.0.1 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number