This project aims to offer a common solution for fully-automated deployments on all versions of Magento 2. This tool uses the well known Deployer and adds specific recipes for each Magento 2 version.
composer require "jalogut/magento2-deployer-plus"
cp <vendor_dir>/jalogut/magento2-deployer-plus/deploy.php.sample_2_1 deploy.php
cp <vendor_dir>/jalogut/magento2-deployer-plus/deploy.php.sample_2_2 deploy.php
cp <vendor_dir>/jalogut/magento2-deployer-plus/deploy.php.sample_2_2_5 deploy.php
<bin_dir>/dep deploy [<stage>]
<bin_dir>/dep build
<bin_dir>/dep deploy-artifact [<stage>]
Build command can only be used if config propagation is properly configured. See Magento DevDocs:
Also check app:config:dump
issue and workaround here:
Problem: Known Magento issue when executing setup:static-content:deploy
for several languages.
Github Issues:
Solution: Until that gets fixed in 2.2.1
, the only workaround is to execute setup:static-content:deploy
individually for each language:
// deploy.php
task('files:static_assets', '
{{bin/php}} {{magento_bin}} setup:static-content:deploy en_US {{static_deploy_options}}
{{bin/php}} {{magento_bin}} setup:static-content:deploy de_CH {{static_deploy_options}}
{{bin/php}} {{magento_bin}} setup:static-content:deploy fr_FR {{static_deploy_options}}
');
memory_limit
configuration to 728M o 1024M[LogicException] Unable to load theme by specified key: 'Template'
@variable
is undefined in filesetup:upgrade
is required before executing setup:static-content:deploy
Solution: Skip setup:static-content:deploy
first time you deploy the new template:
Temporary disable task files:static_assets
// deploy.php
task('files:static_assets')->onRoles('Skip');
Perform a new release
Enable back files:static_assets
on your deploy.php
file
task('files:static_assets')->onRoles('Skip');
Manually execute files:static_assets
<bin_dir>/dep files:static_assets [<stage>]
After that, future deployments will work without issues
GNU General Public License, version 3 (GPLv3)
(c) Juan Alonso juan.jalogut@gmail.com