Deploy Magento 2 site using Capistrano
-
Ruby 2.0 or higher.
-
Project using Git or other source control.
-
Bundler gem (global or local gem).
Using bundler for install dependencies gem
bundle install --path vendor/bundle
File | Constant |
---|---|
app/etc/env.production.php | ADMIN_PATH, MYSQL_HOST, DB_NAME, DB_USERNAME, DB_PASSWORD |
config/deploy/production.rb | :deploy_to, server, user, role |
config/deploy.rb | :application, :repo_url, SERVER_USER, SERVER_GROUP, MAGENTO_USERNAME, MAGENTO_PASSWORD |
-
Upload adminer.php: Do not use it for production.
-
Copy config.php: The Magento project must be contain config.php.dist inside app/etc/ folder.
-
Restart PHP FPM: To flush cache of Zend Opcache extension.
Single application server deploy for each stage, e.g for production:
bundle exec cap production deploy
https://github.com/bundler/bundler