-
Notifications
You must be signed in to change notification settings - Fork 6
/
Magento2.php
56 lines (46 loc) · 1.46 KB
/
Magento2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace Hypernode\DeployConfiguration\ApplicationTemplate;
use Hypernode\DeployConfiguration\Configuration;
class Magento2 extends Configuration
{
/**
* @param string[] $locales
*/
public function __construct(array $locales)
{
parent::__construct();
$this->initializeDefaultConfiguration($locales);
}
/**
* Initialize defaults
*
* @param string[] $locales
*/
private function initializeDefaultConfiguration(array $locales): void
{
$this->setRecipe('magento2');
$this->setVariable('static_content_locales', implode(' ', $locales));
$this->setVariable('env', ['MAGE_MODE' => 'production'], 'build');
$this->addBuildTask('deploy:vendors');
$this->addBuildTask('magento:compile');
$this->addBuildTask('magento:deploy:assets');
$this->addDeployTask('magento:config:import');
$this->addDeployTask('magento:upgrade:db');
$this->addDeployTask('magento:cache:flush');
$this->setSharedFiles([
'app/etc/env.php',
'pub/errors/local.xml',
'pub/.user.ini',
]);
$this->setSharedFolders([
'var/log',
'var/report',
'var/session',
'pub/media',
]);
$this->addDeployExclude('phpserver/');
$this->addDeployExclude('docker/');
$this->addDeployExclude('dev/');
$this->addDeployExclude('deploy/');
}
}