Skip to content

Commit

Permalink
Merge pull request #91 from magento-commerce/MCLOUD-8574
Browse files Browse the repository at this point in the history
MCLOUD-8574: Release Cloud Tools
  • Loading branch information
BaDos authored Mar 31, 2022
2 parents 2f3258a + 2e87738 commit 1d4bd41
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
23 changes: 23 additions & 0 deletions images/elasticsearch/7.10/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions images/elasticsearch/7.10/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions images/elasticsearch/7.10/docker-healthcheck.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion src/Command/Image/GenerateEs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 : '',
]
)
);
Expand Down

0 comments on commit 1d4bd41

Please sign in to comment.