{"action":"created","issue":{"url":"https://api.github.com/repos/deployphp/deployer/issues/878","repository_url":"https://api.github.com/repos/deployphp/deployer","labels_url":"https://api.github.com/repos/deployphp/deployer/issues/878/labels{/name}","comments_url":"https://api.github.com/repos/deployphp/deployer/issues/878/comments","events_url":"https://api.github.com/repos/deployphp/deployer/issues/878/events","html_url":"https://github.com/deployphp/deployer/issues/878","id":189977574,"number":878,"title":"[SF_RECIPE] Add conditional statement for composer options","user":{"login":"rmasclef","id":11849873,"avatar_url":"https://avatars.githubusercontent.com/u/11849873?v=3","gravatar_id":"","url":"https://api.github.com/users/rmasclef","html_url":"https://github.com/rmasclef","followers_url":"https://api.github.com/users/rmasclef/followers","following_url":"https://api.github.com/users/rmasclef/following{/other_user}","gists_url":"https://api.github.com/users/rmasclef/gists{/gist_id}","starred_url":"https://api.github.com/users/rmasclef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmasclef/subscriptions","organizations_url":"https://api.github.com/users/rmasclef/orgs","repos_url":"https://api.github.com/users/rmasclef/repos","events_url":"https://api.github.com/users/rmasclef/events{/privacy}","received_events_url":"https://api.github.com/users/rmasclef/received_events","type":"User","site_admin":false},"labels":[{"id":47395265,"url":"https://api.github.com/repos/deployphp/deployer/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-17T08:44:02Z","updated_at":"2016-11-17T13:46:56Z","closed_at":null,"body":"| Q                 | A\r\n| ----------------- | ---\r\n| Issue Type        | Feature Request\r\n| Deployer Version  | 4.0\r\n| Local Machine OS  | Debian Jessie (8.6)\r\n| Remote Machine OS | Debian Jessie (8.6)\r\n\r\n### Description \r\nAt this time, `composer_options` is automatically skipping dev dependencies with the `--no-dev` option.\r\n\r\nWhen talking about `development` environments, I think that a lot of developers likes to have the `devDependencies` downloaded on the environment (for example to have the symfony debug toolbar ...).\r\n\r\nAt this time, if a developer wants this feature, he can override the `composer_options` in his deploy file like below :\r\n```php\r\n{...}\r\n\r\n//Define composer option to add the dev dependancies when the dev environment is set\r\nset(\r\n    'composer_options',\r\n    '{{composer_action}} --verbose --prefer-dist --no-interaction --optimize-autoloader'.\r\n    get('env') !== 'dev' ? '--no-dev' : ''\r\n);\r\n\r\n{...}\r\n```\r\n\r\nThe idea is to automatically add the composer dev dependencies to the project if the environment is set to a defined value ('dev', 'qualif', 'staging' ... to be defined).\r\n\r\nOr we can imagine an option call `dev_environments`where the user define the environments where he wants dev dependencies to be deployed :)"},"comment":{"url":"https://api.github.com/repos/deployphp/deployer/issues/comments/261250339","html_url":"https://github.com/deployphp/deployer/issues/878#issuecomment-261250339","issue_url":"https://api.github.com/repos/deployphp/deployer/issues/878","id":261250339,"user":{"login":"rmasclef","id":11849873,"avatar_url":"https://avatars.githubusercontent.com/u/11849873?v=3","gravatar_id":"","url":"https://api.github.com/users/rmasclef","html_url":"https://github.com/rmasclef","followers_url":"https://api.github.com/users/rmasclef/followers","following_url":"https://api.github.com/users/rmasclef/following{/other_user}","gists_url":"https://api.github.com/users/rmasclef/gists{/gist_id}","starred_url":"https://api.github.com/users/rmasclef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmasclef/subscriptions","organizations_url":"https://api.github.com/users/rmasclef/orgs","repos_url":"https://api.github.com/users/rmasclef/repos","events_url":"https://api.github.com/users/rmasclef/events{/privacy}","received_events_url":"https://api.github.com/users/rmasclef/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T13:46:56Z","updated_at":"2016-11-17T13:46:56Z","body":"It will work, but if you have many stages in which you want to have dev dep, you will have to add this line of code for each of them ..."}}
{"actor":{"display_login":"rmasclef"}}