From 15a280b449ce7ec905385c81fe49a63356a4dc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 14 Mar 2018 13:51:57 +0100 Subject: [PATCH] delete old es index if mapper attachments plugin is found --- .pkgr.yml | 5 +++++ contrib/packager.io/functions | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.pkgr.yml b/.pkgr.yml index a4828c79f..6a8a9355b 100644 --- a/.pkgr.yml +++ b/.pkgr.yml @@ -5,27 +5,32 @@ notifications: false targets: centos-7: dependencies: + - curl - elasticsearch - nginx - postgresql-server - which debian-8: dependencies: + - curl - elasticsearch - nginx|apache2 - postgresql|mysql-server|mariadb-server|sqlite debian-9: dependencies: + - curl - elasticsearch - nginx|apache2 - postgresql|mariadb-server|sqlite ubuntu-16.04: dependencies: + - curl - elasticsearch - nginx|apache2 - postgresql|mysql-server|mariadb-server|sqlite sles-12: dependencies: + - curl - elasticsearch - nginx - postgresql-server diff --git a/contrib/packager.io/functions b/contrib/packager.io/functions index 68302f6c8..569ed2c2c 100644 --- a/contrib/packager.io/functions +++ b/contrib/packager.io/functions @@ -230,7 +230,12 @@ function setup_elasticsearch () { if [ -n "$(/usr/share/elasticsearch/bin/elasticsearch-plugin list | grep mapper-attachments)" ]; then REBUILD_ES_SEARCHINDEX="yes" + + echo "# Deleting old zammad_production elasticsearch index..." + curl -XDELETE '127.0.0.1:9200/zammad_production' + 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