diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index fa071ee..43936ca 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,11 @@ ## CHANGELOG +### ?.?.? + +- Add support for calling composer ezplatform-install (script) on "initialdata" argument + + ### 1.4.0 - Add SOLR_CORES env variable on solr container to define the core(s) name. (default = "collection1") diff --git a/payload/recipes/ez_install.bash b/payload/recipes/ez_install.bash index d14faf2..7b9809b 100755 --- a/payload/recipes/ez_install.bash +++ b/payload/recipes/ez_install.bash @@ -45,7 +45,15 @@ if [ -f app/console ]; then CONSOLE="app/console" fi -$PHP $CONSOLE ezplatform:install $INIT_DATA + +# Prefer install via composer alias (added in v2.2, required for eZ Commerce) +if $COMPOSER run-script -l | grep -q " $INIT_DATA "; then + $COMPOSER run-script $INIT_DATA +else + $PHP $CONSOLE ezplatform:install $INIT_DATA +fi + + echo "Installation OK" diff --git a/src/Command/Docker/Initialize.php b/src/Command/Docker/Initialize.php index 817a145..fcbf5d8 100644 --- a/src/Command/Docker/Initialize.php +++ b/src/Command/Docker/Initialize.php @@ -57,7 +57,12 @@ protected function configure() $this->setAliases(['docker:init', 'initialize', 'init']); $this->addArgument('repository', InputArgument::OPTIONAL, 'eZ Platform Repository', 'ezsystems/ezplatform'); $this->addArgument('version', InputArgument::OPTIONAL, 'eZ Platform Version', '2.*'); - $this->addArgument('initialdata', InputArgument::OPTIONAL, 'eZ Platform Initial', 'clean'); + $this->addArgument( + 'initialdata', + InputArgument::OPTIONAL, + 'Installer: If avaiable uses "composer run-script ", if not uses ezplatform:install command', + 'clean' + ); } /** @@ -190,6 +195,8 @@ protected function innerInitialize( if ('clean' === $initialdata && false !== strpos($repository, 'ezplatform-ee')) { $initialdata = 'ezplatform-ee-clean'; + } elseif ('clean' === $initialdata && false !== strpos($repository, 'ezcommerce')) { + $initialdata = 'ezcommerce-install'; } $executor->eZInstall($input->getArgument('version'), $repository, $initialdata);