diff --git a/contrib/packager.io/functions b/contrib/packager.io/functions index 1d10e9c6b..3475225b6 100644 --- a/contrib/packager.io/functions +++ b/contrib/packager.io/functions @@ -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 }