added es namespace setting

This commit is contained in:
André Bauer 2020-03-27 13:31:22 +01:00 committed by GitHub
parent f48fca238e
commit c5751c06f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,6 +6,7 @@ set -e
: "${ELASTICSEARCH_HOST:=zammad-elasticsearch}"
: "${ELASTICSEARCH_PORT:=9200}"
: "${ELASTICSEARCH_SCHEMA:=http}"
: "${ELASTICSEARCH_NAMESPACE:=zammad}"
: "${ELASTICSEARCH_SSL_VERIFY:=true}"
: "${MEMCACHED_HOST:=zammad-memcached}"
: "${MEMCACHED_PORT:=11211}"
@ -70,6 +71,8 @@ if [ "$1" = 'zammad-init' ]; then
echo "changing settings..."
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')"
if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then
bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")"
bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")"