Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ function () {
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\CronConsumersRunner::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\DbConnection::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\Amqp::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\Storage::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\Session::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\SearchEngine::class),
$this->container->make(DeployProcess\InstallUpdate\ConfigUpdate\Urls::class),
Expand Down
10 changes: 10 additions & 0 deletions src/Config/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,16 @@ public function getSchema()
StageConfigInterface::STAGE_DEPLOY => [],
],
],
DeployInterface::VAR_STORAGE_CONFIGURATION => [
self::SCHEMA_TYPE => ['array'],
self::SCHEMA_STAGE => [
StageConfigInterface::STAGE_GLOBAL,
StageConfigInterface::STAGE_DEPLOY
],
self::SCHEMA_DEFAULT_VALUE => [
StageConfigInterface::STAGE_DEPLOY => [],
],
],
DeployInterface::VAR_RESOURCE_CONFIGURATION => [
self::SCHEMA_TYPE => ['array'],
self::SCHEMA_STAGE => [
Expand Down
1 change: 1 addition & 0 deletions src/Config/Stage/DeployInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface DeployInterface extends StageConfigInterface
const VAR_CACHE_CONFIGURATION = 'CACHE_CONFIGURATION';
const VAR_SESSION_CONFIGURATION = 'SESSION_CONFIGURATION';
const VAR_DATABASE_CONFIGURATION = 'DATABASE_CONFIGURATION';
const VAR_STORAGE_CONFIGURATION = 'STORAGE_CONFIGURATION';
const VAR_RESOURCE_CONFIGURATION = 'RESOURCE_CONFIGURATION';
const VAR_CRON_CONSUMERS_RUNNER = 'CRON_CONSUMERS_RUNNER';
const VAR_CONSUMERS_WAIT_FOR_MAX_MESSAGES = 'CONSUMERS_WAIT_FOR_MAX_MESSAGES';
Expand Down
61 changes: 61 additions & 0 deletions src/Process/Deploy/InstallUpdate/ConfigUpdate/Storage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

namespace Magento\MagentoCloud\Process\Deploy\InstallUpdate\ConfigUpdate;

use Magento\MagentoCloud\Config\Deploy\Reader as ConfigReader;
use Magento\MagentoCloud\Config\Deploy\Writer as ConfigWriter;
use Magento\MagentoCloud\Process\Deploy\InstallUpdate\ConfigUpdate\Storage\Config;
use Magento\MagentoCloud\Process\ProcessInterface;
use Psr\Log\LoggerInterface;

class Storage implements ProcessInterface
{
/**
* @var ConfigReader
*/
private $configReader;
/**
* @var ConfigWriter
*/
private $configWriter;
/**
* @var LoggerInterface
*/
private $logger;
/**
* @var Config
*/
private $storageConfig;

/**
* Storage constructor.
*/
public function __construct(
ConfigReader $configReader,
ConfigWriter $configWriter,
LoggerInterface $logger,
Config $storageConfig
)
{
$this->configReader = $configReader;
$this->configWriter = $configWriter;
$this->logger = $logger;
$this->storageConfig = $storageConfig;
}


/**
* Executes the step.
*
* @return void
*/
public function execute()
{
$config = $this->configReader->read();
$this->logger->info('Updating storage configuration.');

$config['storage'] = $this->storageConfig->get();

$this->configWriter->create($config);
}
}
29 changes: 29 additions & 0 deletions src/Process/Deploy/InstallUpdate/ConfigUpdate/Storage/Config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Magento\MagentoCloud\Process\Deploy\InstallUpdate\ConfigUpdate\Storage;

use Magento\MagentoCloud\Config\Stage\DeployInterface;

class Config
{
/**
* @var DeployInterface
*/
private $stageConfig;

/**
* Config constructor.
*/
public function __construct(
DeployInterface $stageConfig
)
{
$this->stageConfig = $stageConfig;
}

public function get(): array
{
$envStorageConfiguration = (array)$this->stageConfig->get(DeployInterface::VAR_STORAGE_CONFIGURATION);
return $envStorageConfiguration;
}
}