2016-03-07 12:00:30 -05:00
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
|
|
|
import org.elasticsearch.gradle.VersionProperties
|
2015-11-24 20:10:46 -05:00
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
apply plugin: 'elasticsearch.build'
|
2015-11-24 20:10:46 -05:00
|
|
|
|
|
|
|
dependencies {
|
2016-03-07 12:00:30 -05:00
|
|
|
provided "org.elasticsearch:elasticsearch:${versions.elasticsearch}"
|
2015-11-25 18:28:45 -05:00
|
|
|
provided project(path: ':x-plugins:elasticsearch:x-pack', configuration: 'runtime')
|
2016-08-31 11:48:26 -04:00
|
|
|
|
|
|
|
testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}"
|
|
|
|
testCompile project(path: ':x-plugins:elasticsearch:x-pack-transport', configuration: 'runtime')
|
2015-11-24 20:10:46 -05:00
|
|
|
}
|
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
Map generateSubstitutions() {
|
|
|
|
def stringSnap = { version ->
|
|
|
|
if (version.endsWith("-SNAPSHOT")) {
|
|
|
|
return version.substring(0, version.length() - 9)
|
|
|
|
}
|
|
|
|
return version
|
|
|
|
}
|
|
|
|
return [
|
|
|
|
'version': stringSnap(version),
|
|
|
|
'xpack.version': stringSnap(VersionProperties.elasticsearch),
|
|
|
|
'java.version': targetCompatibility as String
|
|
|
|
]
|
|
|
|
}
|
2015-11-24 20:10:46 -05:00
|
|
|
|
2016-04-12 09:19:07 -04:00
|
|
|
String outputDir = "generated-resources/${project.name}"
|
|
|
|
task copyXPackPluginProps(type: Copy) {
|
|
|
|
from project(':x-plugins:elasticsearch:x-pack').file('src/main/plugin-metadata')
|
|
|
|
from project(':x-plugins:elasticsearch:x-pack').tasks.pluginProperties
|
|
|
|
into outputDir
|
|
|
|
}
|
|
|
|
project.sourceSets.test.output.dir(outputDir, builtBy: copyXPackPluginProps)
|
|
|
|
|
2016-03-07 12:00:30 -05:00
|
|
|
processResources {
|
|
|
|
MavenFilteringHack.filter(it, generateSubstitutions())
|
|
|
|
}
|
|
|
|
|
|
|
|
task buildZip(type:Zip, dependsOn: [jar]) {
|
2016-03-30 03:07:57 -04:00
|
|
|
from 'build/resources/main/x-pack-extension-descriptor.properties'
|
2016-06-02 08:43:00 -04:00
|
|
|
from 'build/resources/main/x-pack-extension-security.policy'
|
2016-03-07 12:00:30 -05:00
|
|
|
from project.jar
|
|
|
|
}
|
|
|
|
|
|
|
|
task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn: buildZip) {
|
2015-11-24 20:10:46 -05:00
|
|
|
cluster {
|
2016-07-15 17:36:13 -04:00
|
|
|
plugin ':x-plugins:elasticsearch:x-pack'
|
2016-03-22 17:40:45 -04:00
|
|
|
setting 'xpack.security.authc.realms.custom.order', '0'
|
|
|
|
setting 'xpack.security.authc.realms.custom.type', 'custom'
|
2016-08-29 15:18:08 -04:00
|
|
|
setting 'xpack.security.authc.realms.custom.filtered_setting', 'should be filtered'
|
2016-03-22 17:40:45 -04:00
|
|
|
setting 'xpack.security.authc.realms.esusers.order', '1'
|
|
|
|
setting 'xpack.security.authc.realms.esusers.type', 'file'
|
2015-11-24 20:10:46 -05:00
|
|
|
|
|
|
|
setupCommand 'setupDummyUser',
|
2016-02-10 09:42:59 -05:00
|
|
|
'bin/x-pack/users', 'useradd', 'test_user', '-p', 'changeme', '-r', 'superuser'
|
2016-03-07 12:00:30 -05:00
|
|
|
setupCommand 'installExtension',
|
2016-03-30 03:07:57 -04:00
|
|
|
'bin/x-pack/extension', 'install', 'file:' + buildZip.archivePath
|
2015-11-24 20:10:46 -05:00
|
|
|
waitCondition = { node, ant ->
|
|
|
|
File tmpFile = new File(node.cwd, 'wait.success')
|
2015-12-11 21:23:01 -05:00
|
|
|
ant.get(src: "http://${node.httpUri()}",
|
2015-11-24 20:10:46 -05:00
|
|
|
dest: tmpFile.toString(),
|
|
|
|
username: 'test_user',
|
|
|
|
password: 'changeme',
|
|
|
|
ignoreerrors: true,
|
|
|
|
retries: 10)
|
|
|
|
return tmpFile.exists()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-07 12:00:30 -05:00
|
|
|
check.dependsOn integTest
|
2016-03-30 03:07:57 -04:00
|
|
|
integTest.mustRunAfter precommit
|