Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit 50e7447

Browse files
Removing plugin files from git and downloading them upon tests start
1 parent 34c1b46 commit 50e7447

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+54
-81
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ web-app
88
*.log
99
*.zip
1010
plugin.xml
11-
/docs
11+
/docs
12+
13+
# Elasticsearch plugins installation
14+
test/resources/plugins

scripts/_Events.groovy

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
11
import org.apache.commons.io.FileUtils
22

3+
eventAllTestsStart = { msg ->
4+
File pluginsDir = new File('test/resources/plugins')
5+
6+
Map<String, String> elasticsearchPlugins = [
7+
'elasticsearch-mapper-attachments' : '3.1.2'
8+
]
9+
10+
if (!pluginsDir.exists()) {
11+
12+
println "Installing Elasticsearch Plugins ..."
13+
14+
pluginsDir.mkdirs()
15+
16+
elasticsearchPlugins.each { pluginName, pluginVersion ->
17+
18+
String versionedPluginName = "${pluginName}-${pluginVersion}"
19+
String artifactURL = "http://search.maven.org/remotecontent?filepath=org/elasticsearch/${pluginName}/${pluginVersion}/${versionedPluginName}.zip"
20+
21+
//Download handling redirects
22+
File tmpZip = new File(pluginsDir, "${versionedPluginName}.zip")
23+
while( artifactURL ) {
24+
artifactURL.toURL().openConnection().with { conn ->
25+
conn.instanceFollowRedirects = false
26+
artifactURL = conn.getHeaderField( "Location" )
27+
if( !artifactURL ) {
28+
tmpZip.withOutputStream { out ->
29+
conn.inputStream.with { inp ->
30+
out << inp
31+
inp.close()
32+
}
33+
}
34+
}
35+
}
36+
}
37+
38+
//Explode the plugin
39+
File explodedPlugin = new File(pluginsDir, versionedPluginName)
40+
explodedPlugin.mkdirs()
41+
new AntBuilder().unzip(src: tmpZip.path, dest: explodedPlugin.path, overwrite: false)
42+
43+
//Delete downloaded file
44+
tmpZip.delete()
45+
println "Elasticsearch Plugin : ${versionedPluginName} INSTALLED!"
46+
}
47+
48+
49+
}
50+
}
51+
352
eventTestCaseStart = { name ->
453
println '-' * 60
554
println "| $name : started"
@@ -15,4 +64,5 @@ eventAllTestsEnd = {msg ->
1564
println "Cleaning up ElasticSerch data directory"
1665
FileUtils.deleteDirectory(dataFolder)
1766
}
67+
println "MC - HERE END!!!"
1868
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/resources/plugins/elasticsearch-mapper-attachments-3.1.2/plugin-descriptor.properties

Lines changed: 0 additions & 80 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)