Skip to content

Commit

Permalink
Merge pull request #393 from manala/elao.app.docker/elasticsearch
Browse files Browse the repository at this point in the history
[Elao.app.docker] redesign Elasticsearch management
  • Loading branch information
greedybro authored Sep 5, 2023
2 parents a53f0c0 + 1d4502b commit e358f84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion elao.app.docker/.manala.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ system:
config: {}
elasticsearch:
# @option {"label": "Elasticsearch version"}
# @schema {"enum": [null, 8, 7, 6, 5]}
# @schema {"enum": [null, 8, "7.17.12", 7, 6, 5]}
version: ~
# @schema {"items": {"type": "string"}}
plugins: []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{{/* Elasticsearch version */}}
{{- define "elasticsearch_version" -}}
{{- $elasticsearch_versions := dict 5 "5.6.16" 6 "6.8.23" 7 "7.17.9" 8 "8.1.3" -}}
{{- $version := .version -}}
{{- index $elasticsearch_versions ($version | toString) -}}
{{- with index $elasticsearch_versions (.version | toString) -}}
{{ . }}
{{- else -}}
{{ .version }}
{{- end }}
{{- end -}}

{{ if .Vars.system.elasticsearch.version -}}
Expand All @@ -15,7 +18,7 @@ services:

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:{{ include "elasticsearch_version" .Vars.system.elasticsearch }}
{{- if le (.Vars.system.elasticsearch.version|int) 6 }}
{{- if semverCompare "<=6" (include "elasticsearch_version" .Vars.system.elasticsearch) }}
# docker.elastic.co/elasticsearch/elasticsearch image unavailable for arm64 on version <= 6
# force amd64 architecture
platform: linux/amd64
Expand All @@ -28,7 +31,7 @@ services:
command: >
sh -c
"{{- range $plugin := $.Vars.system.elasticsearch.plugins }}((elasticsearch-plugin list|grep {{ $plugin }}) || elasticsearch-plugin install --batch --verbose {{ $plugin }}) && {{ end -}}
{{- if le (.Vars.system.elasticsearch.version|int) 5 }}
{{- if semverCompare "<=5" (include "elasticsearch_version" .Vars.system.elasticsearch) }}
exec bin/es-docker"
{{- else }}
exec docker-entrypoint.sh"
Expand Down

0 comments on commit e358f84

Please sign in to comment.