From a58f90d1823f5b15a090bc6275f6aad25eb64cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Serwatka?= Date: Mon, 12 Mar 2018 14:39:07 +0100 Subject: [PATCH 1/5] [composer] Configure requirements for 2.1 beta release --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ccbfdaf0..cd12322c 100644 --- a/composer.json +++ b/composer.json @@ -35,13 +35,13 @@ "doctrine/orm": "^2.5", "sensio/distribution-bundle": "^5.0.19", "incenteev/composer-parameter-handler": "~2.1", - "ezsystems/ezpublish-kernel": "^7.0@dev", - "ezsystems/repository-forms": "^2.0@dev", + "ezsystems/ezpublish-kernel": "^7.1@dev", + "ezsystems/repository-forms": "^2.1@dev", "ezsystems/ezplatform-solr-search-engine": "^1.5@dev", "ezsystems/ez-support-tools": "^0.2@dev", "ezsystems/ezplatform-http-cache": "^0.5@dev", - "ezsystems/ezplatform-admin-ui": "^1.0@dev", - "ezsystems/ezplatform-admin-ui-modules": "^1.0@dev", + "ezsystems/ezplatform-admin-ui": "^1.1@dev", + "ezsystems/ezplatform-admin-ui-modules": "^1.1@dev", "ezsystems/ezplatform-admin-ui-assets": "^2.0@dev", "ezsystems/ezplatform-design-engine": "^1.1", "knplabs/knp-menu-bundle": "^2.1", From 905dedad48de425c47089dd33c935ccbe023d9eb Mon Sep 17 00:00:00 2001 From: dennisxrow Date: Mon, 19 Mar 2018 14:16:32 +0100 Subject: [PATCH 2/5] Aligned bin/console script with symfony-standard (#271) --- bin/console | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/console b/bin/console index 5af600e5..5544f89b 100755 --- a/bin/console +++ b/bin/console @@ -26,5 +26,6 @@ if ($debug) { Debug::enable(); } -$application = new Application(new AppKernel($env, $debug)); +$kernel = new AppKernel($env, $debug); +$application = new Application($kernel); $application->run($input); From e1de8329c26366655cf0839a54eb44de97239fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20R?= Date: Tue, 20 Mar 2018 16:36:52 +0100 Subject: [PATCH 3/5] EZEE-1910: [Platform.sh] Speed up deployment when in production to avoid downtime (#276) * EZEE-1910: [Platform.sh] Speed up deployment when in production to avoid downtime * [Platform.sh] Add class cache clearing when re-deploying prod When re-deploying a already deployed platform tree id (git commit), for instance when build failed for random reasons. * Change to use mv if folder exits on deploy --- .platform.app.yaml | 24 ++++++++++++++++++------ app/AppKernel.php | 10 ++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.platform.app.yaml b/.platform.app.yaml index ca397ffd..d4b3c534 100644 --- a/.platform.app.yaml +++ b/.platform.app.yaml @@ -66,26 +66,38 @@ hooks: build: | set -e rm web/app_dev.php - . ./.env if [ "$SYMFONY_ENV" = "dev" ] ; then composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader else composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader fi # Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point + # Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s deploy: | set -e - . ./.env + # Mainly relevant for eZ Platform demo usage, for own setup adapt this or remove and rely on migrations. if [ ! -f web/var/.platform.installed ]; then + . ./.env php -d memory_limit=-1 app/console ezplatform:install $INSTALL_EZ_INSTALL_TYPE touch web/var/.platform.installed fi - # As we are deploying code changes we need to clear any kind of code/system cache - rm -Rf app/cache/*/*.* - app/console cache:clear - # Example of addtional deploy hooks if you use doctrine and/or kaliop migration bundle + # When deploying changes to existing cluster, clear all cache now that we have shared mounts available + if [ "$SYMFONY_ENV" != "prod" ] ; then + # Clear class cache before we boot up symfony in case of interface changes on classes cached + rm -Rf app/cache/$SYMFONY_ENV/*.* + app/console cache:clear + elif [ -d "app/cache/prod/$PLATFORM_TREE_ID" ] ; then + # Clear cache on re-deploy when the folder exits, move folder so post_deploy can cleanup + mv -f app/cache/prod/$PLATFORM_TREE_ID app/cache/prod/old_deploy + fi + # Example of additional deploy hooks if you use doctrine and/or kaliop migration bundle ##app/console doctrine:migrations:migrate --no-interaction --allow-no-migration ##app/console kaliop:migration:migrate --no-interaction --no-debug + # Post deploy hook, like deploy but after being deployed and live, for deploy tasks we can do asynchronously + post_deploy: | + set -e + # Cleanup old prod cache folders, basically all except current $PLATFORM_TREE_ID folder. + find app/cache/prod -mindepth 1 -maxdepth 1 -type d \! \( -name "$PLATFORM_TREE_ID" \) -exec rm -rf '{}' \; # The configuration of scheduled execution. # see http://symfony.com/doc/current/components/console/introduction.html diff --git a/app/AppKernel.php b/app/AppKernel.php index 007ec741..f4d0a015 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -67,6 +67,16 @@ public function registerBundles() return $bundles; } + public function getCacheDir() + { + // On platform.sh place each deployment cache in own folder to rather cleanup old cache async + if ($this->getEnvironment() === 'prod' && ($platformTreeId = getenv('PLATFORM_TREE_ID'))) { + return "{$this->getRootDir()}/cache/{$this->getEnvironment()}/{$platformTreeId}"; + } + + return parent::getCacheDir(); + } + /** * Loads the container configuration. * From 71258e912a192618132c00db2a8be9c9db594895 Mon Sep 17 00:00:00 2001 From: Maciej Kobus Date: Wed, 21 Mar 2018 13:48:05 +0100 Subject: [PATCH 4/5] EZP-28962: The OPTIONS REST routes are not loaded anymore (#279) --- app/config/routing.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/config/routing.yml b/app/config/routing.yml index fa0814d4..58f64b44 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -13,7 +13,12 @@ kernel.internal: kernel.rest: resource: '@EzPublishRestBundle/Resources/config/routing.yml' - prefix: /api/ezp/v2 + prefix: '%ezpublish_rest.path_prefix%' + +kernel.rest.options: + resource: '@EzPublishRestBundle/Resources/config/routing.yml' + prefix: '%ezpublish_rest.path_prefix%' + type: rest_options ezplatform.admin_ui: resource: '@EzPlatformAdminUiBundle/Resources/config/routing.yml' From 0cfbcac6c21199220fd63c4ccdf2ac0537c9d61b Mon Sep 17 00:00:00 2001 From: Vidar Date: Thu, 22 Mar 2018 09:56:32 +0100 Subject: [PATCH 5/5] Fixed typo so session can be stored in rediscache in Platform.sh (#281) --- app/config/env/platformsh.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/env/platformsh.php b/app/config/env/platformsh.php index ac02d9c5..ffa4ad4e 100644 --- a/app/config/env/platformsh.php +++ b/app/config/env/platformsh.php @@ -103,7 +103,7 @@ $container->setParameter('session.save_path', sprintf('%s:%d', $endpoint['host'], $endpoint['port'])); } } elseif (isset($relationships['rediscache'])) { - foreach ($relationships['redissession'] as $endpoint) { + foreach ($relationships['rediscache'] as $endpoint) { if ($endpoint['scheme'] !== 'redis') { continue; }