Config for Magento 2
This is a sample configuration that suffices for most magento2 installations:
<?php
namespace Hypernode\DeployConfiguration;
$configuration = new ApplicationTemplate\Magento2(['en_US']);
$productionStage = $configuration->addStage('production', 'magento2.komkommer.store');
$productionStage->addServer('appname.hypernode.io');
return $configuration;
By using the Magento2 ApplicationTemplate, a bunch of default configuration gets set in Hypernode Deploy, and should work out-of-the-box for most magento 2 stores.
These are the steps that will be executed by running your deployment:
Advanced
However, for advanced configurations you can override most steps and variables set my Hypernode Deploy:
Static Content Locales
When the deployer runs bin/magento static-content:deploy
it will require locales to know what to build, this variable is set for this. It is included when you run new ApplicationTemplate\Magento2
or can be overriden with:
$this->setVariable('static_content_locales', 'nl_NL en_US');
Defining custom steps
You potentially need to add custom steps to the deployment, for example to build npm assets or do server actions after deployment.
task('node:install', static function () {
run("npm ci");
});
task('node:build', static function () {
run('npm run build');
});
// Add builder task to run in the pipeline, use addDeployTask to run on the server
$configuration->addBuildTask('node:install');
$configuration->addBuildTask('node:build');