Skip to content

Commit

Permalink
MAGECLOUD-1739: Consider Removing Per-node Hook Functionality (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftedreality authored May 21, 2018
1 parent b2fc6df commit de064a5
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 1,355 deletions.
2 changes: 1 addition & 1 deletion bin/ece-tools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
$container = require_once __DIR__ . '/../bootstrap.php';
$container = require __DIR__ . '/../bootstrap.php';

$application = new \Magento\MagentoCloud\Application($container);
$application->run();
23 changes: 0 additions & 23 deletions src/App/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Magento\MagentoCloud\Command\DbDump;
use Magento\MagentoCloud\Command\Deploy;
use Magento\MagentoCloud\Command\ConfigDump;
use Magento\MagentoCloud\Command\Prestart;
use Magento\MagentoCloud\Command\PostDeploy;
use Magento\MagentoCloud\Config\ValidatorInterface;
use Magento\MagentoCloud\Config\Validator as ConfigValidator;
Expand All @@ -26,10 +25,8 @@
use Magento\MagentoCloud\Process\DbDump as DbDumpProcess;
use Magento\MagentoCloud\Process\Deploy as DeployProcess;
use Magento\MagentoCloud\Process\ConfigDump as ConfigDumpProcess;
use Magento\MagentoCloud\Process\Prestart as PrestartProcess;
use Magento\MagentoCloud\Process\PostDeploy as PostDeployProcess;
use Psr\Container\ContainerInterface;
use Magento\MagentoCloud\Process;

/**
* @inheritdoc
Expand Down Expand Up @@ -88,7 +85,6 @@ function () {
return new Flag\Pool([
Flag\Manager::FLAG_REGENERATE => 'var/.regenerate',
Flag\Manager::FLAG_STATIC_CONTENT_DEPLOY_IN_BUILD => '.static_content_deploy',
Flag\Manager::FLAG_STATIC_CONTENT_DEPLOY_PENDING => 'var/.static_content_deploy_pending',
Flag\Manager::FLAG_DEPLOY_HOOK_IS_FAILED => 'var/.deploy_is_failed',
]);
}
Expand Down Expand Up @@ -280,16 +276,6 @@ function () {
$this->container->when(DeployProcess\InstallUpdate\ConfigUpdate\DbConnection::class)
->needs(ConnectionInterface::class)
->give(ReadConnection::class);
$this->container->when(Prestart::class)
->needs(ProcessInterface::class)
->give(function () {
return $this->container->makeWith(ProcessComposite::class, [
'processes' => [
$this->container->make(PrestartProcess\DeployStaticContent::class),
$this->container->make(PrestartProcess\CompressStaticContent::class),
],
]);
});
$this->container->when(DeployProcess\InstallUpdate\ConfigUpdate\Urls::class)
->needs(ProcessInterface::class)
->give(function () {
Expand Down Expand Up @@ -342,15 +328,6 @@ function () {
],
]);
});
$this->container->when(PrestartProcess\DeployStaticContent::class)
->needs(ProcessInterface::class)
->give(function () {
return $this->container->makeWith(ProcessComposite::class, [
'processes' => [
$this->get(PrestartProcess\DeployStaticContent\Generate::class),
],
]);
});
$this->container->when(DbDump::class)
->needs(ProcessInterface::class)
->give(function () {
Expand Down
1 change: 0 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ protected function getDefaultCommands()
$this->container->get(Command\Build::class),
$this->container->get(Command\Deploy::class),
$this->container->get(Command\ConfigDump::class),
$this->container->get(Command\Prestart::class),
$this->container->get(Command\DbDump::class),
$this->container->get(Command\PostDeploy::class),
$this->container->get(Command\CronUnlock::class),
Expand Down
73 changes: 0 additions & 73 deletions src/Command/Prestart.php

This file was deleted.

5 changes: 0 additions & 5 deletions src/Filesystem/Flag/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class Manager
*/
const FLAG_STATIC_CONTENT_DEPLOY_IN_BUILD = 'scd_in_build';

/**
* Used for postponing static content deployment until prestart phase.
*/
const FLAG_STATIC_CONTENT_DEPLOY_PENDING = 'scd_pending';

/**
* Used to mark that deploy hook is failed.
*/
Expand Down
4 changes: 0 additions & 4 deletions src/Process/Deploy/CompressStaticContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public function execute()
if (!$this->stageConfig->get(DeployInterface::VAR_SKIP_SCD)
&& $this->environment->isDeployStaticContent()
) {
if ($this->flagManager->exists(FlagManager::FLAG_STATIC_CONTENT_DEPLOY_PENDING)) {
$this->logger->info('Postpone static content compression until prestart');
return;
}
$this->staticContentCompressor->process(
$this->stageConfig->get(DeployInterface::VAR_SCD_COMPRESSION_LEVEL),
$this->stageConfig->get(DeployInterface::VAR_VERBOSE_COMMANDS)
Expand Down
29 changes: 0 additions & 29 deletions src/Process/Deploy/DeployStaticContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
use Magento\MagentoCloud\Config\Environment;
use Magento\MagentoCloud\Config\GlobalSection as GlobalConfig;
use Magento\MagentoCloud\Config\Stage\DeployInterface;
use Magento\MagentoCloud\Filesystem\Flag\Manager as FlagManager;
use Magento\MagentoCloud\Process\ProcessInterface;
use Magento\MagentoCloud\Util\RemoteDiskIdentifier;
use Psr\Log\LoggerInterface;
use Magento\MagentoCloud\Util\StaticContentCleaner;

Expand All @@ -34,16 +32,6 @@ class DeployStaticContent implements ProcessInterface
*/
private $logger;

/**
* @var RemoteDiskIdentifier
*/
private $remoteDiskIdentifier;

/**
* @var FlagManager
*/
private $flagManager;

/**
* @var DeployInterface
*/
Expand All @@ -63,8 +51,6 @@ class DeployStaticContent implements ProcessInterface
* @param ProcessInterface $process
* @param Environment $environment
* @param LoggerInterface $logger
* @param RemoteDiskIdentifier $remoteDiskIdentifier
* @param FlagManager $flagManager
* @param DeployInterface $stageConfig
* @param GlobalConfig $globalConfig
* @param StaticContentCleaner $staticContentCleaner
Expand All @@ -73,17 +59,13 @@ public function __construct(
ProcessInterface $process,
Environment $environment,
LoggerInterface $logger,
RemoteDiskIdentifier $remoteDiskIdentifier,
FlagManager $flagManager,
DeployInterface $stageConfig,
GlobalConfig $globalConfig,
StaticContentCleaner $staticContentCleaner
) {
$this->process = $process;
$this->environment = $environment;
$this->logger = $logger;
$this->remoteDiskIdentifier = $remoteDiskIdentifier;
$this->flagManager = $flagManager;
$this->stageConfig = $stageConfig;
$this->globalConfig = $globalConfig;
$this->staticContentCleaner = $staticContentCleaner;
Expand All @@ -98,24 +80,13 @@ public function __construct(
*/
public function execute()
{
$this->flagManager->delete(FlagManager::FLAG_STATIC_CONTENT_DEPLOY_PENDING);

if ($this->globalConfig->get(DeployInterface::VAR_SCD_ON_DEMAND)) {
$this->logger->notice('Skipping static content deploy. SCD on demand is enabled.');
$this->staticContentCleaner->clean();

return;
}

if ($this->remoteDiskIdentifier->isOnLocalDisk('pub/static')
&& !$this->flagManager->exists(FlagManager::FLAG_STATIC_CONTENT_DEPLOY_IN_BUILD)
) {
$this->flagManager->set(FlagManager::FLAG_STATIC_CONTENT_DEPLOY_PENDING);
$this->logger->info('Postpone static content deployment until prestart');

return;
}

if ($this->stageConfig->get(DeployInterface::VAR_SKIP_SCD)
|| !$this->environment->isDeployStaticContent()
) {
Expand Down
88 changes: 0 additions & 88 deletions src/Process/Prestart/CompressStaticContent.php

This file was deleted.

Loading

0 comments on commit de064a5

Please sign in to comment.