Allow starting without Elasticsearch.
This commit is contained in:
parent
83438a63a4
commit
338ca514af
@ -3,6 +3,7 @@
|
||||
set -e
|
||||
|
||||
: "${AUTOWIZARD_JSON:=''}"
|
||||
: "${ELASTICSEARCH_ENABLED:=true}"
|
||||
: "${ELASTICSEARCH_HOST:=zammad-elasticsearch}"
|
||||
: "${ELASTICSEARCH_PORT:=9200}"
|
||||
: "${ELASTICSEARCH_SCHEMA:=http}"
|
||||
@ -77,6 +78,9 @@ if [ "$1" = 'zammad-init' ]; then
|
||||
|
||||
# es config
|
||||
echo "changing settings..."
|
||||
if [ "${ELASTICSEARCH_ENABLED}" == "false" ]; then
|
||||
bundle exec rails r "Setting.set('es_url', '')"
|
||||
else
|
||||
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
|
||||
|
||||
bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')"
|
||||
@ -101,6 +105,7 @@ if [ "$1" = 'zammad-init' ]; then
|
||||
echo "rebuilding es searchindex..."
|
||||
bundle exec rake searchindex:rebuild
|
||||
fi
|
||||
fi
|
||||
|
||||
# chown everything to zammad user
|
||||
chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${ZAMMAD_DIR}"
|
||||
|
Loading…
Reference in New Issue
Block a user