-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.php
64 lines (48 loc) · 2.21 KB
/
deploy.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
57
58
59
60
61
62
63
64
<?php
declare(strict_types=1);
namespace Hypernode\DeployConfiguration;
use Hypernode\DeployConfiguration\PlatformConfiguration\HypernodeSettingConfiguration;
use function Deployer\{after, before, invoke, run, task};
$configuration = new ApplicationTemplate\Magento2(['en_US']);
$configuration->addPlatformConfiguration(
new HypernodeSettingConfiguration('php_version', '8.3')
);
task('magento:prepare_env:test', static function () {
run('cp ~/apps/magento2.komkommer.store/shared/app/etc/env.php {{release_path}}/app/etc/env.php');
run('cd {{release_path}}; n98-magerun2 config:env:set db.connection.default.host mysqlmaster');
invoke('magento:cache:flush');
})->select('stage=test');
task('magento:configure_env:test', static function () {
run('{{bin/php}} {{release_path}}/bin/magento config:set web/unsecure/base_url https://{{hostname}}/');
run('{{bin/php}} {{release_path}}/bin/magento config:set web/secure/base_url https://{{hostname}}/');
invoke('magento:cache:flush');
})->select('stage=test');
task('hmv:configure:test', static function () {
run('hypernode-manage-vhosts {{hostname}} --https --force-https --type magento2 --webroot {{current_path}}/{{public_folder}}');
})->select('stage=test');
before('magento:config:import', 'magento:prepare_env:test');
after('magento:config:import', 'magento:configure_env:test');
$configuration->addDeployTask('hmv:configure:test');
$stagingStage = $configuration->addStage('staging', 'staging.magento2.komkommer.store', 'hypernode');
$stagingStage->addServer('production1135-hypernode.hipex.io');
$productionStage = $configuration->addStage('production', 'magento2.komkommer.store');
$productionStage->addServer('hntestgroot.hypernode.io');
$testStage = $configuration->addStage('test', 'test.komkommer.store');
$testStage->addBrancherServer('hntestgroot')
->setLabels(['stage=test', 'ci_ref=' . (\getenv('GITHUB_HEAD_REF') ?: 'none')]);
$configuration->setSharedFiles([
'app/etc/env.php',
'pub/errors/local.xml',
'.user.ini',
'pub/.user.ini'
]);
$configuration->setSharedFolders([
'var/log',
'var/session',
'var/report',
'var/export',
'pub/media',
'pub/sitemaps',
'pub/static/_cache'
]);
return $configuration;