{"action":"created","issue":{"url":"https://api.github.com/repos/deployphp/deployer/issues/713","repository_url":"https://api.github.com/repos/deployphp/deployer","labels_url":"https://api.github.com/repos/deployphp/deployer/issues/713/labels{/name}","comments_url":"https://api.github.com/repos/deployphp/deployer/issues/713/comments","events_url":"https://api.github.com/repos/deployphp/deployer/issues/713/events","html_url":"https://github.com/deployphp/deployer/issues/713","id":162022425,"number":713,"title":"Magento2 Recepipe","user":{"login":"barryvdh","id":973269,"avatar_url":"https://avatars.githubusercontent.com/u/973269?v=3","gravatar_id":"","url":"https://api.github.com/users/barryvdh","html_url":"https://github.com/barryvdh","followers_url":"https://api.github.com/users/barryvdh/followers","following_url":"https://api.github.com/users/barryvdh/following{/other_user}","gists_url":"https://api.github.com/users/barryvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/barryvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barryvdh/subscriptions","organizations_url":"https://api.github.com/users/barryvdh/orgs","repos_url":"https://api.github.com/users/barryvdh/repos","events_url":"https://api.github.com/users/barryvdh/events{/privacy}","received_events_url":"https://api.github.com/users/barryvdh/received_events","type":"User","site_admin":false},"labels":[{"id":176763198,"url":"https://api.github.com/repos/deployphp/deployer/labels/discuss","name":"discuss","color":"f7c6c7","default":false},{"id":52049995,"url":"https://api.github.com/repos/deployphp/deployer/labels/feature","name":"feature","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-06-23T21:02:09Z","updated_at":"2016-12-23T10:20:21Z","closed_at":null,"body":"| Q | A |\n| --- | --- |\n| Issue Type | Feature Request |\n\nThere is a Magento1 recipe, should we start working on Magento2?\n- Works with Composer\n- uses bin/magento binary file for commands\n- needs to share files/folders\n\nFlush cache\n\n``` php\ntask('magento:cache:flush', function () {\n    $output = run('{{bin/php}} {{deploy_path}}/current/bin/magento cache:flush');\n    writeln('<info>' . $output . '</info>');\n})->desc('Flush cache');\n```\n\nGenerate static content\n\n``` php\ntask('magento:static-content', function () {\n    $output = run('{{bin/php}} {{deploy_path}}/current/bin/magento setup:static-content:deploy nl_NL');\n    writeln('<info>' . $output . '</info>');\n})->desc('Clear cache');\n```\n\nNeeds a first-time install script, that copies the env.php/config.php? How do you usually handle that?\n\n``` php\ntask('install', [\n    'deploy:prepare',\n    'deploy:release',\n    'deploy:update_code',\n    'deploy:vendors',\n    'deploy:symlink',\n    'magento:install',\n]);\n\nenv('magento_install_options',\n'--db-host=localhost --db-name=magento --db-user=magento ' .\n'--admin-firstname=Magento --admin-lastname=User --admin-email=admin@example.com ' .\n'--admin-user=admin --admin-password=admin123 --language=nl_NL '.\n'--currency=EUR --timezone=Europe/Amsterdam --cleanup-database '.\n'--session-save=db --use-rewrites=1');\n\ntask('magento:install', function() {\n    $confirm = askConfirmation('Are you sure? This will (re-)install Magento!');\n    if (!$confirm) {\n        writeln('<comment>Aborted</comment>');\n        return 0;\n    }\n    $dbPass = ask('What is the DB password?','');\n    $output = run('{{bin/php}} {{deploy_path}}/current/bin/magento setup:install --base-url=http://'.env('server.host').' --db-password=\"'. $dbPass.'\" {{magento_install_options}}');\n    writeln('<info>' . $output . '</info>');\n\n  //Not sure what this should be exactly\n   // run(\"cp {{release_path}}/app/etc/env.php {{deploy_path}}/shared/app/etc/env.php\");\n    // run(\"cp {{release_path}}/app/etc/config.php {{deploy_path}}/shared/app/etc/config.php\");\n\n});\n```\n\nDeploy\n\n``` php\ntask('deploy', [\n    'deploy:prepare',\n    'deploy:release',\n    'deploy:update_code',\n    'deploy:shared',\n    'deploy:vendors',\n    'magento:static-content',\n    'deploy:symlink',\n    'deploy:writable',\n    'cleanup',\n    'magento:cache:flush',\n]);\n```\n\nOther options:\n- Enabe maintenance mode\n- di:compile\n- permissions\n  .. ?\n\nReferences:\nhttp://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-subcommands.html\nhttp://davidalger.com/development/magento/deploying-magento-2-using-capistrano/\nhttps://github.com/davidalger/capistrano-magento2\n"},"comment":{"url":"https://api.github.com/repos/deployphp/deployer/issues/comments/268968771","html_url":"https://github.com/deployphp/deployer/issues/713#issuecomment-268968771","issue_url":"https://api.github.com/repos/deployphp/deployer/issues/713","id":268968771,"user":{"login":"peterjaap","id":431360,"avatar_url":"https://avatars.githubusercontent.com/u/431360?v=3","gravatar_id":"","url":"https://api.github.com/users/peterjaap","html_url":"https://github.com/peterjaap","followers_url":"https://api.github.com/users/peterjaap/followers","following_url":"https://api.github.com/users/peterjaap/following{/other_user}","gists_url":"https://api.github.com/users/peterjaap/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjaap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjaap/subscriptions","organizations_url":"https://api.github.com/users/peterjaap/orgs","repos_url":"https://api.github.com/users/peterjaap/repos","events_url":"https://api.github.com/users/peterjaap/events{/privacy}","received_events_url":"https://api.github.com/users/peterjaap/received_events","type":"User","site_admin":false},"created_at":"2016-12-23T10:20:21Z","updated_at":"2016-12-23T10:20:21Z","body":"Will do that as soon as we're actually deploying our M2 project :)"}}
{"actor":{"display_login":"peterjaap"}}