From 62e9ad496ddf183f6e702223779d61169e58e36f Mon Sep 17 00:00:00 2001 From: Okabe Rintaro Date: Fri, 29 Jul 2022 11:37:37 +0300 Subject: [PATCH] use elasticsearch 6.8 cma image for magento 2.3.0-2.3.4 --- build-packages/magento-scripts/lib/config/docker.js | 2 +- .../lib/config/services/elasticsearch/base-repo.js | 3 +++ .../elasticsearch/versions/elasticsearch-6.8.js | 12 ++++++++++++ .../config/services/elasticsearch/versions/index.js | 5 +++++ .../lib/config/versions/magento-2.3.0.js | 5 ++--- .../lib/config/versions/magento-2.3.1.js | 5 ++--- .../lib/config/versions/magento-2.3.2-p1.js | 5 ++--- .../lib/config/versions/magento-2.3.2-p2.js | 5 ++--- .../lib/config/versions/magento-2.3.2.js | 5 ++--- .../lib/config/versions/magento-2.3.3-p1.js | 5 ++--- .../lib/config/versions/magento-2.3.3.js | 5 ++--- .../lib/config/versions/magento-2.3.4-p1.js | 5 ++--- .../lib/config/versions/magento-2.3.4-p2.js | 5 ++--- .../lib/config/versions/magento-2.3.4.js | 5 ++--- 14 files changed, 41 insertions(+), 31 deletions(-) create mode 100644 build-packages/magento-scripts/lib/config/services/elasticsearch/base-repo.js create mode 100644 build-packages/magento-scripts/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js create mode 100644 build-packages/magento-scripts/lib/config/services/elasticsearch/versions/index.js diff --git a/build-packages/magento-scripts/lib/config/docker.js b/build-packages/magento-scripts/lib/config/docker.js index 75dd4aaf..5d12552c 100644 --- a/build-packages/magento-scripts/lib/config/docker.js +++ b/build-packages/magento-scripts/lib/config/docker.js @@ -271,7 +271,7 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => { 'xpack.ml.enabled': ['sse4.2', 'sse4_2'].some((sse42Flag) => cpuSupportedFlags.includes(sse42Flag)) }, network: network.name, - image: `elasticsearch:${ elasticsearch.version }`, + image: `${ elasticsearch.version ? `elasticsearch:${ elasticsearch.version }` : elasticsearch.image }`, name: `${ prefix }_elasticsearch` } }; diff --git a/build-packages/magento-scripts/lib/config/services/elasticsearch/base-repo.js b/build-packages/magento-scripts/lib/config/services/elasticsearch/base-repo.js new file mode 100644 index 00000000..f233675f --- /dev/null +++ b/build-packages/magento-scripts/lib/config/services/elasticsearch/base-repo.js @@ -0,0 +1,3 @@ +module.exports = { + repo: 'ghcr.io/scandipwa/create-magento-app' +}; diff --git a/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js b/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js new file mode 100644 index 00000000..de8095f8 --- /dev/null +++ b/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js @@ -0,0 +1,12 @@ +const { repo } = require('../base-repo'); + +/** + * @returns {import('../../../../../typings/index').ServiceWithImage} + */ +const elasticsearch68 = ({ + image = `${ repo }:elasticsearch-6.8` +} = {}) => ({ + image +}); + +module.exports = elasticsearch68; diff --git a/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/index.js b/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/index.js new file mode 100644 index 00000000..20a3356d --- /dev/null +++ b/build-packages/magento-scripts/lib/config/services/elasticsearch/versions/index.js @@ -0,0 +1,5 @@ +const elasticsearch68 = require('./elasticsearch-6.8'); + +module.exports = { + elasticsearch68 +}; diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.0.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.0.js index 0122ba18..09f7841a 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.0.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.0.js @@ -3,6 +3,7 @@ const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); const { php72 } = require('../php/versions'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { sslTerminator } = require('../ssl-terminator'); const { varnish66 } = require('../varnish/varnish-6-6'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '5.6.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.1.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.1.js index 4d33d198..c5950961 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.1.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.1.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p1.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p1.js index 0dc611f8..97ee4262 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p1.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p1.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p2.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p2.js index 32fc9c80..dea3ff7a 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p2.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2-p2.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2.js index da61e665..4abd1a08 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.2.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.2.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.3-p1.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.3-p1.js index d1a29365..ed062dc8 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.3-p1.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.3-p1.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.3.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.3.js index 40707f30..5fb69f5f 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.3.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.3.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p1.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p1.js index b2c31da9..79806cf3 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p1.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p1.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p2.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p2.js index e5a6bcb3..a8d8cdcb 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p2.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4-p2.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' }, diff --git a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4.js b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4.js index cfd38782..541d7d3b 100644 --- a/build-packages/magento-scripts/lib/config/versions/magento-2.3.4.js +++ b/build-packages/magento-scripts/lib/config/versions/magento-2.3.4.js @@ -1,4 +1,5 @@ const path = require('path'); +const { elasticsearch68 } = require('../services/elasticsearch/versions'); const { defaultMagentoConfig } = require('../magento-config'); const { magento23PHPExtensionList } = require('../magento/required-php-extensions'); const { repo } = require('../php/base-repo'); @@ -27,9 +28,7 @@ module.exports = ({ templateDir } = {}) => ({ mariadb: { version: '10.2' }, - elasticsearch: { - version: '6.8.16' - }, + elasticsearch: elasticsearch68(), composer: { version: '1' },