[build] simplify ant script for plugins

Now we are using short names for artifactId (see #12879) so we don't need anymore to transform long names `elasticsearch-pluginname` to short names `pluginname` in ant script when we install a plugin.
Modify also convert-plugin-name
Clean up remaining plugins with old format
And fix vagrant tests
This commit is contained in:
David Pilato 2015-08-18 18:19:41 +02:00
parent c57755095c
commit 0599f85d2d
5 changed files with 16 additions and 27 deletions

View File

@ -93,21 +93,11 @@
</nested> </nested>
</run-script> </run-script>
<!-- check that plugin was installed into correct place --> <fail message="did not find plugin installed as @{name}">
<local name="longname"/>
<property name="longname" value="@{name}"/>
<local name="shortname"/>
<filter-property src="longname" dest="shortname">
<chain>
<replaceregex pattern="^elasticsearch-" replace=""/>
</chain>
</filter-property>
<fail message="did not find plugin installed as ${shortname}">
<condition> <condition>
<not> <not>
<resourceexists> <resourceexists>
<file file="@{home}/plugins/${shortname}"/> <file file="@{home}/plugins/@{name}"/>
</resourceexists> </resourceexists>
</not> </not>
</condition> </condition>
@ -203,8 +193,8 @@
</macrodef> </macrodef>
<!-- Takes a plugin zip file and return the plugin name. For instance <!-- Takes a plugin zip file and return the plugin name. For instance
'elasticsearch-analysis-icu-2.0.0.zip' would return 'analysis-icu-2.0.0.zip' would return
'elasticsearch-analysis-icu'. --> 'analysis-icu'. -->
<macrodef name="convert-plugin-name"> <macrodef name="convert-plugin-name">
<attribute name="file"/> <attribute name="file"/>
<attribute name="outputproperty"/> <attribute name="outputproperty"/>
@ -213,7 +203,6 @@
<basename file="@{file}" property="file.base"/> <basename file="@{file}" property="file.base"/>
<filter-property src="file.base" dest="@{outputproperty}"> <filter-property src="file.base" dest="@{outputproperty}">
<chain> <chain>
<replaceregex pattern="^elasticsearch-" replace=""/>
<replacestring from="-${elasticsearch.version}.zip" to=""/> <replacestring from="-${elasticsearch.version}.zip" to=""/>
</chain> </chain>
</filter-property> </filter-property>

View File

@ -94,7 +94,7 @@
</artifactItem> </artifactItem>
<artifactItem> <artifactItem>
<groupId>org.elasticsearch.plugin</groupId> <groupId>org.elasticsearch.plugin</groupId>
<artifactId>elasticsearch-jvm-example</artifactId> <artifactId>jvm-example</artifactId>
<version>${elasticsearch.version}</version> <version>${elasticsearch.version}</version>
<type>zip</type> <type>zip</type>
</artifactItem> </artifactItem>

View File

@ -61,7 +61,7 @@ setup() {
assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml" assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
echo "Running jvm-example's bin script...." echo "Running jvm-example's bin script...."
/tmp/elasticsearch/bin/jvm-example/test | grep test /tmp/elasticsearch/bin/jvm-example/test | grep test
@ -106,7 +106,7 @@ setup() {
assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml" assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/plugin-descriptor.properties" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/plugin-descriptor.properties"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /tmp/elasticsearch/bin/plugin remove jvm-example run /tmp/elasticsearch/bin/plugin remove jvm-example
@ -156,7 +156,7 @@ setup() {
assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml" assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /tmp/elasticsearch/bin/plugin remove jvm-example run /tmp/elasticsearch/bin/plugin remove jvm-example
@ -210,7 +210,7 @@ setup() {
assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml" assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /tmp/elasticsearch/bin/plugin remove jvm-example run /tmp/elasticsearch/bin/plugin remove jvm-example
@ -254,7 +254,7 @@ setup() {
assert_file_exist "$ES_DIR/config/jvm-example/example.yaml" assert_file_exist "$ES_DIR/config/jvm-example/example.yaml"
assert_file_exist "$ES_DIR/plugins/jvm-example" assert_file_exist "$ES_DIR/plugins/jvm-example"
assert_file_exist "$ES_DIR/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "$ES_DIR/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "$ES_DIR/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "$ES_DIR/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run "$ES_DIR/bin/plugin" remove jvm-example run "$ES_DIR/bin/plugin" remove jvm-example
@ -298,7 +298,7 @@ setup() {
assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml" assert_file_exist "/tmp/elasticsearch/config/jvm-example/example.yaml"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/tmp/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /tmp/elasticsearch/bin/plugin remove jvm-example run /tmp/elasticsearch/bin/plugin remove jvm-example

View File

@ -74,7 +74,7 @@ install_package() {
assert_file_exist "/etc/elasticsearch/jvm-example/example.yaml" assert_file_exist "/etc/elasticsearch/jvm-example/example.yaml"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /usr/share/elasticsearch/bin/plugin remove jvm-example run /usr/share/elasticsearch/bin/plugin remove jvm-example
@ -121,7 +121,7 @@ install_package() {
assert_file_exist "/etc/elasticsearch/jvm-example/example.yaml" assert_file_exist "/etc/elasticsearch/jvm-example/example.yaml"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/plugin-descriptor.properties" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/plugin-descriptor.properties"
assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "$TEMP_PLUGINS_DIR/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
@ -183,7 +183,7 @@ install_package() {
assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml" assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /usr/share/elasticsearch/bin/plugin remove jvm-example run /usr/share/elasticsearch/bin/plugin remove jvm-example
@ -241,7 +241,7 @@ install_package() {
assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml" assert_file_exist "$TEMP_CONFIG_DIR/jvm-example/example.yaml"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/plugin-descriptor.properties"
assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/elasticsearch-jvm-example-"*".jar" assert_file_exist "/usr/share/elasticsearch/plugins/jvm-example/jvm-example-"*".jar"
# Remove the plugin # Remove the plugin
run /usr/share/elasticsearch/bin/plugin remove jvm-example run /usr/share/elasticsearch/bin/plugin remove jvm-example

View File

@ -27,7 +27,7 @@
# Variables used by tests # Variables used by tests
EXAMPLE_PLUGIN_ZIP=$(readlink -m elasticsearch-jvm-example-*.zip) EXAMPLE_PLUGIN_ZIP=$(readlink -m jvm-example-*.zip)
# Checks if necessary commands are available to run the tests # Checks if necessary commands are available to run the tests