added elasticsearch plugin update
This commit is contained in:
parent
c36c288be3
commit
4b54642fcc
1 changed files with 22 additions and 8 deletions
|
@ -227,22 +227,38 @@ function create_webserver_config () {
|
||||||
|
|
||||||
function setup_elasticsearch () {
|
function setup_elasticsearch () {
|
||||||
echo "# Configuring Elasticsearch..."
|
echo "# Configuring Elasticsearch..."
|
||||||
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-attachments
|
|
||||||
|
if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then
|
||||||
|
REBUILD_ES_SEARCHINDEX="yes"
|
||||||
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove mapper-attachments
|
||||||
|
elif [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep ingest-attachment)" ]; then
|
||||||
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s remove ingest-attachment
|
||||||
|
fi
|
||||||
|
|
||||||
|
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment
|
||||||
|
|
||||||
${INIT_CMD} restart elasticsearch
|
${INIT_CMD} restart elasticsearch
|
||||||
zammad run rails r "Setting.set('es_url', \"${ES_CONNECTION:-http://127.0.0.1:9200}\")"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function elasticsearch_searchindex_rebuild () {
|
function elasticsearch_searchindex_rebuild () {
|
||||||
|
if [ "${REBUILD_ES_SEARCHINDEX}" == "yes" ]; then
|
||||||
echo "# (Re)building Elasticsearch searchindex..."
|
echo "# (Re)building Elasticsearch searchindex..."
|
||||||
|
|
||||||
|
zammad run rails r "Setting.set('es_url', \"${ES_CONNECTION:-http://127.0.0.1:9200}\")"
|
||||||
|
|
||||||
zammad run rake searchindex:rebuild
|
zammad run rake searchindex:rebuild
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_or_install () {
|
function update_or_install () {
|
||||||
|
setup_elasticsearch
|
||||||
|
|
||||||
if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
|
if [ -f ${ZAMMAD_DIR}/config/database.yml ]; then
|
||||||
update_database
|
update_database
|
||||||
|
|
||||||
update_translations
|
update_translations
|
||||||
else
|
else
|
||||||
|
REBUILD_ES_SEARCHINDEX="yes"
|
||||||
create_database_password
|
create_database_password
|
||||||
|
|
||||||
if [ "${ADAPTER}" == "postgresql" ]; then
|
if [ "${ADAPTER}" == "postgresql" ]; then
|
||||||
|
@ -255,12 +271,10 @@ function update_or_install () {
|
||||||
|
|
||||||
update_database_yml
|
update_database_yml
|
||||||
|
|
||||||
setup_elasticsearch
|
|
||||||
|
|
||||||
initialise_database
|
initialise_database
|
||||||
|
fi
|
||||||
|
|
||||||
elasticsearch_searchindex_rebuild
|
elasticsearch_searchindex_rebuild
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_env_vars () {
|
function set_env_vars () {
|
||||||
|
|
Loading…
Reference in a new issue