added elasticsearch config to package install

This commit is contained in:
André Bauer 2017-09-17 01:39:12 +02:00
parent ca3b34aec4
commit 6fda64c7f6

View file

@ -200,7 +200,7 @@ function create_webserver_config () {
mv /etc/${WEBSERVER}/sites-enabled/zammad.conf ${WEBSERVER_CONF}
else
cp ${ZAMMAD_DIR}/contrib/${WEBSERVER}/zammad.conf ${WEBSERVER_CONF}
fi
fi
ln -s ${WEBSERVER_CONF} /etc/${WEBSERVER}/sites-enabled/zammad.conf
fi
if [ "${WEBSERVER}" == "apache2" ]; then
@ -219,6 +219,15 @@ function create_webserver_config () {
${INIT_CMD} restart ${WEBSERVER_CMD}
}
function setup_elasticsearch () {
echo "# Configuring Elasticsearch..."
/usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-attachments
${INIT_CMD} restart elasticsearch
sleep 10
zammad run rails r "Setting.set('es_url', \"${ES_CONNECTION:-http://127.0.0.1:9200}\")"
zammad run rake searchindex:rebuild
}
function update_or_install () {
if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
update_database
@ -236,6 +245,8 @@ function update_or_install () {
update_database_yml
initialise_database
setup_elasticsearch
fi
}