From 1a2aced5ce82060fa17103c68b30c4c645dbcc0c Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 21 Mar 2022 19:41:37 -0500 Subject: [PATCH 1/2] MCLOUD-8548: Add ElasticSearch 7.10 image (#90) --- images/elasticsearch/7.10/Dockerfile | 23 +++++++++++++++++++ .../elasticsearch/7.10/docker-entrypoint.sh | 12 ++++++++++ .../elasticsearch/7.10/docker-healthcheck.sh | 12 ++++++++++ src/Command/Image/GenerateEs.php | 6 ++++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 images/elasticsearch/7.10/Dockerfile create mode 100755 images/elasticsearch/7.10/docker-entrypoint.sh create mode 100644 images/elasticsearch/7.10/docker-healthcheck.sh diff --git a/images/elasticsearch/7.10/Dockerfile b/images/elasticsearch/7.10/Dockerfile new file mode 100644 index 00000000..fcb58764 --- /dev/null +++ b/images/elasticsearch/7.10/Dockerfile @@ -0,0 +1,23 @@ +FROM docker.elastic.co/elasticsearch/elasticsearch:7.10.2 + +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=https://mirror.rackspace.com\/centos-vault|g' /etc/yum.repos.d/CentOS-Linux-* && \ + yum -y install zip && \ + zip -q -d /usr/share/elasticsearch/lib/log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class && \ + yum remove -y zip && \ + yum -y clean all && \ + rm -rf /var/cache + +RUN echo "xpack.security.enabled: false" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN echo "discovery.type: single-node" >> /usr/share/elasticsearch/config/elasticsearch.yml +RUN bin/elasticsearch-plugin install -b analysis-icu && \ + bin/elasticsearch-plugin install -b analysis-phonetic + +ADD docker-healthcheck.sh /docker-healthcheck.sh +ADD docker-entrypoint.sh /docker-entrypoint.sh + +HEALTHCHECK --retries=3 CMD ["bash", "/docker-healthcheck.sh"] + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 9200 9300 diff --git a/images/elasticsearch/7.10/docker-entrypoint.sh b/images/elasticsearch/7.10/docker-entrypoint.sh new file mode 100755 index 00000000..e2c63c4c --- /dev/null +++ b/images/elasticsearch/7.10/docker-entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if [[ -n "$ES_PLUGINS" ]]; then + echo "Installing plugins: $ES_PLUGNS" + for PLUGIN in $ES_PLUGINS + do + ./bin/elasticsearch-plugin install -b "$PLUGIN" + done +fi + +/bin/bash /usr/local/bin/docker-entrypoint.sh diff --git a/images/elasticsearch/7.10/docker-healthcheck.sh b/images/elasticsearch/7.10/docker-healthcheck.sh new file mode 100644 index 00000000..a6d853cf --- /dev/null +++ b/images/elasticsearch/7.10/docker-healthcheck.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -eo pipefail + +if health="$(curl -fsSL "http://${ES_HOST:-elasticsearch}:${ES_PORT:-9200}/_cat/health?h=status")"; then + health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") + if [ "$health" = 'green' ] || [ "$health" = 'yellow' ]; then + exit 0 + fi + echo >&2 "Unexpected health status: $health" +fi + +exit 1 diff --git a/src/Command/Image/GenerateEs.php b/src/Command/Image/GenerateEs.php index 51ac68e2..d9ca8c9a 100644 --- a/src/Command/Image/GenerateEs.php +++ b/src/Command/Image/GenerateEs.php @@ -55,6 +55,10 @@ class GenerateEs extends Command 'real-version' => '7.9.3', 'single-node' => true, ], + '7.10' => [ + 'real-version' => '7.10.2', + 'single-node' => true, + ], '7.11' => [ 'real-version' => '7.11.2', 'single-node' => true, @@ -128,7 +132,7 @@ public function execute(InputInterface $input, OutputInterface $output): int [ '{%version%}' => $versionData['real-version'], '{%single_node%}' => $versionData['single-node'] ? self::SINGLE_NODE : '', - '{%fix_repos%}' => ($version === '7.11') ? $fixRepo : '', + '{%fix_repos%}' => in_array($version, ['7.10', '7.11']) ? $fixRepo : '', ] ) ); From 2e87738b15fee7e3d05ccb7d816038538f96dad4 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 29 Mar 2022 11:34:48 -0500 Subject: [PATCH 2/2] MCLOUD-8574: Release Cloud Tools --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5aa6184f..c83d64a0 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-docker", "description": "Magento Cloud Docker", "type": "magento2-component", - "version": "1.3.1", + "version": "1.3.2", "license": [ "OSL-3.0", "AFL-3.0"