Skip to content

Instantly share code, notes, and snippets.

@gehel
Created March 1, 2017 16:01
Show Gist options
  • Save gehel/c2ddf2d0b1b8e47077b1633db80eddd0 to your computer and use it in GitHub Desktop.
Save gehel/c2ddf2d0b1b8e47077b1633db80eddd0 to your computer and use it in GitHub Desktop.
upload elasticsearch plugins
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.wikimedia.search</groupId>
<artifactId>upload-plugins</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<elasticsearch.version>5.2.2</elasticsearch.version>
<lucene.version>6.4.1</lucene.version>
</properties>
<dependencies>
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>analysis-icu</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-icu</artifactId>
<version>${lucene.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>54.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>analysis-stempel</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-stempel</artifactId>
<version>${lucene.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-common</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
#!/usr/bin/env bash
set -e
ELASTICSEARCH_VERSION=5.2.2
PLUGINS="analysis-icu analysis-stempel"
temp_dir=$(mktemp -d)
echo "using ${temp_dir} as temporary directory for downloads"
for plugin in $PLUGINS; do
plugin_filename=${plugin}-${ELASTICSEARCH_VERSION}.zip
curl -o ${temp_dir}/${plugin_filename} \
https://artifacts.elastic.co/downloads/elasticsearch-plugins/${plugin}/${plugin_filename}
unzip ${temp_dir}/${plugin_filename} -d ${temp_dir}
mvn install:install-file \
-Dfile=${temp_dir}/elasticsearch/${plugin}-${ELASTICSEARCH_VERSION}.jar \
-DgroupId=org.elasticsearch.plugin \
-DartifactId=${plugin} \
-Dversion=${ELASTICSEARCH_VERSION} \
-Dpackaging=jar \
-DgeneratePom=true
rm -rf ${temp_dir}/elasticsearch ${temp_dir}/${plugin_filename}
done
echo "removing temporary directory ${temp_dir}"
rmdir ${temp_dir}
mvn -Dmdep.copyPom=true dependency:copy-dependencies
echo "The following files are going to be uploaded to archiva"
ls target/dependency
echo "press [Ctrl]-[C] to abort or [Enter] to continue..."
read
for pom in target/dependency/*.pom; do
mvn deploy:deploy-file \
-DrepositoryId=archiva.wikimedia.org \
-Durl=https://archiva.wikimedia.org/repository/mirrored \
-Dfile="${pom%%.pom}.jar" \
-DgeneratePom=false \
-DpomFile="${pom}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment