A cookbook to install Composer and maintain composer packages within project deployments.
n/a
:install_path
: The path which composer will be installed:owner
: The owner of the file:dev
: Whether to execute the project activities with the--dev
flag.
default[:composer][:install_path] = "/usr/local/bin"
default[:composer][:owner] = "root" # apache|www-data|root|whatever
default[:composer][:project][:dev] = false
:install
:uninstall
:update
composer "/usr/local/bin" do
owner "root" # optional
action [:install, :update]
end
composer "/usr/local/bin" do
action :uninstall
do
:install
:update
:dump_autoload
composer_project "/var/www/pr1" do
dev true # optional
run_as "www-data" # optional
composer_path "/usr/local/bin" #optional
quiet false #optional
action [:install, :update, :dump_autoload]
end
For backwards compatibility, composer will run in quiet mode by default. However, this can make it very difficult to debug any problems installing packages as it suppresses all error messages. To allow output, set the "quiet" attribute to false.
## composer_project_package
create a custom project from a specific package like symfony (recipe as an example)
:install
:update
composer_project_packages "symfony/framework-standard-edition" do
project_packpath "/var/www"
project_packfolder "Symfony"
project_packversion "2.1.7"
dev false
action [:install]
end
## Recipe Symfony
This recipe install symfony in default folder define or by cutomize the folowing attributes :
:sfpath
: The path which Symfony will be installed:sffolder
: The directory inside the path:sfversion
: The Symfony version to install:sfuser
: Owner:sfgroup
: Owner's group
default[:composer][:sfpath] = "/var/www"
default[:composer][:sffolder] = "Symfony"
default[:composer][:sfversion] = ""
default[:composer][:sfuser] = "vagrant"
default[:composer][:sfgroup] = "vagrant"