Skip to content

Commit 2a6af9a

Browse files
MAGECLOUD-5215: Forward-port delivered changes
1 parent da1574b commit 2a6af9a

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

src/Command/BuildCompose.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class BuildCompose extends Command
6969
self::OPTION_RABBIT_MQ => ServiceInterface::NAME_RABBITMQ,
7070
self::OPTION_EXPOSE_DB_PORT => ProductionBuilder::KEY_EXPOSE_DB_PORT,
7171
self::OPTION_SELENIUM_VERSION => ServiceFactory::SERVICE_SELENIUM_VERSION,
72-
self::OPTION_SELENIUM_IMAGE => ServiceFactory::SERVICE_SELENIUM_IMAGE
72+
self::OPTION_SELENIUM_IMAGE => ServiceFactory::SERVICE_SELENIUM_IMAGE,
7373
];
7474

7575
/**
@@ -220,6 +220,12 @@ protected function configure(): void
220220
))
221221
)
222222
)
223+
->addOption(
224+
self::OPTION_WITH_CRON,
225+
null,
226+
InputOption::VALUE_NONE,
227+
'Add cron container'
228+
)
223229
->addOption(
224230
self::OPTION_NO_VARNISH,
225231
null,

src/Compose/BuilderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ interface BuilderInterface
1919
public const DEFAULT_VARNISH_VERSION = 'latest';
2020
public const DEFAULT_TLS_VERSION = 'latest';
2121

22-
public const KEY_NO_CRON = 'no-cron';
2322
public const KEY_NO_VARNISH = 'no-varnish';
2423
public const KEY_EXPOSE_DB_PORT = 'expose-db-port';
2524
public const KEY_NO_TMP_MOUNTS = 'no-tmp-mounts';
2625
public const KEY_WITH_SELENIUM = 'with-selenium';
2726
public const KEY_SYNC_ENGINE = 'sync-engine';
27+
public const KEY_WITH_CRON = 'with-cron';
2828

2929
public const SERVICE_GENERIC = 'generic';
3030
public const SERVICE_DB = 'db';

src/Compose/ProductionBuilder.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ class ProductionBuilder implements BuilderInterface
3737
public const SYNC_ENGINE_MOUNT = 'mount';
3838
public const DEFAULT_SYNC_ENGINE = self::SYNC_ENGINE_MOUNT;
3939

40-
public const KEY_WITH_CRON = 'with-cron';
41-
public const KEY_EXPOSE_DB_PORT = 'expose-db-port';
42-
public const KEY_NO_TMP_MOUNTS = 'no-tmp-mounts';
43-
public const KEY_WITH_SELENIUM = 'with-selenium';
4440
/**
4541
* @var array
4642
*/
@@ -390,12 +386,15 @@ public function build(Repository $config): Manager
390386
self::$cliDepends
391387
);
392388

393-
if ($this->config->get(self::KEY_WITH_CRON, false)) {
394-
$services['cron'] = $this->getCronCliService(
395-
$phpVersion,
396-
true,
397-
$cliDepends,
398-
'cron.magento2.docker'
389+
if ($config->get(self::KEY_WITH_CRON, false)) {
390+
$manager->addService(
391+
self::SERVICE_CRON,
392+
array_merge(
393+
$this->getCronCliService($phpVersion),
394+
['volumes' => $volumesRo]
395+
),
396+
[self::NETWORK_MAGENTO],
397+
self::$cliDepends
399398
);
400399
}
401400

0 commit comments

Comments
 (0)