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}"
|
|
|
|
testCompile "org.elasticsearch.test:framework:${project.versions.elasticsearch}"
|
2015-11-25 18:28:45 -05:00
|
|
|
provided project(path: ':x-plugins:elasticsearch:x-pack', 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-03-07 12:00:30 -05:00
|
|
|
processResources {
|
|
|
|
MavenFilteringHack.filter(it, generateSubstitutions())
|
|
|
|
}
|
|
|
|
|
|
|
|
task buildZip(type:Zip, dependsOn: [jar]) {
|
|
|
|
from 'build/resources/main/xpack-extension-descriptor.properties'
|
|
|
|
from project.jar
|
|
|
|
}
|
|
|
|
|
|
|
|
task integTest(type: org.elasticsearch.gradle.test.RestIntegTestTask, dependsOn: buildZip) {
|
2015-11-24 20:10:46 -05:00
|
|
|
cluster {
|
2015-11-25 18:28:45 -05:00
|
|
|
plugin 'x-pack', project(':x-plugins:elasticsearch:x-pack')
|
2015-11-24 20:10:46 -05:00
|
|
|
// TODO: these should be settings?
|
2016-03-15 20:01:01 -04:00
|
|
|
setting 'shield.authc.realms.custom.order', '0'
|
|
|
|
setting 'shield.authc.realms.custom.type', 'custom'
|
|
|
|
setting 'shield.authc.realms.esusers.order', '1'
|
|
|
|
setting 'shield.authc.realms.esusers.type', 'esusers'
|
2015-11-24 20:10:46 -05:00
|
|
|
|
|
|
|
setupCommand 'setupDummyUser',
|
2016-02-05 05:13:30 -05:00
|
|
|
'bin/xpack/esusers', 'useradd', 'test_user', '-p', 'changeme', '-r', 'admin'
|
2016-03-07 12:00:30 -05:00
|
|
|
setupCommand 'installExtension',
|
|
|
|
'bin/xpack/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
|
|
|
|
integTest.mustRunAfter precommit
|