Use new wireCompatVersions property instead of bwcVersion (elastic/x-pack-elasticsearch#1466)

This is the xpack side of elastic/elasticsearch#24748

Original commit: elastic/x-pack-elasticsearch@8b7dd5cdbe
This commit is contained in:
Ryan Ernst 2017-05-17 12:58:51 -07:00 committed by GitHub
parent 05daaa8a3c
commit 573da95e26
3 changed files with 97 additions and 92 deletions

View File

@ -45,6 +45,6 @@ subprojects {
}
ext.projectSubstitutions += [
"org.elasticsearch.plugin:x-pack-api:${version}": ':x-pack-elasticsearch:plugin',
"org.elasticsearch.plugin:x-pack:${bwcVersion}": ':x-pack-elasticsearch:plugin:bwc-zip'
"org.elasticsearch.plugin:x-pack:${wireCompatVersions[-1]}": ':x-pack-elasticsearch:plugin:bwc-zip'
]
}

View File

@ -3,14 +3,19 @@ import org.elasticsearch.gradle.LoggedExec
/**
* This is a dummy project which does a local checkout of the previous
* major version's stable branch, and builds a snapshot. This allows backcompat
* tests in the next major version to test against the next unreleased minor
* version, without relying on snapshots.
* wire compat version's branch, and builds a snapshot. This allows backcompat
* tests to test against the next unreleased version, closest to this version,
* without relying on snapshots.
*/
String bwcVersion = wireCompatVersions[-1]
if (bwcVersion.endsWith('-SNAPSHOT')) {
apply plugin: 'distribution'
File esCheckoutDir = file("${buildDir}/bwc/checkout-es-5.x")
def (String major, String minor, String bugfix) = bwcVersion.split('\\.')
String bwcBranch = bugfix == '0-SNAPSHOT' ? "${major}.x" : "${major}.${minor}"
File esCheckoutDir = file("${buildDir}/bwc/checkout-es-${bwcBranch}")
File xpackCheckoutDir = file("${esCheckoutDir}-extra/x-pack-elasticsearch")
task createElasticsearchClone(type: LoggedExec) {
onlyIf { esCheckoutDir.exists() == false }
@ -94,13 +99,13 @@ task fetchXPackLatest(type: LoggedExec) {
task checkoutElasticsearchBwcBranch(type: LoggedExec) {
dependsOn fetchElasticsearchLatest
workingDir = esCheckoutDir
commandLine = ['git', 'checkout', 'upstream/5.x']
commandLine = ['git', 'checkout', "upstream/${bwcBranch}"]
}
task checkoutXPackBwcBranch(type: LoggedExec) {
dependsOn fetchXPackLatest
workingDir = xpackCheckoutDir
commandLine = ['git', 'checkout', 'upstream/5.x']
commandLine = ['git', 'checkout', "upstream/${bwcBranch}"]
}
File bwcZip = file("${xpackCheckoutDir}/plugin/build/distributions/x-pack-${bwcVersion}.zip")
@ -113,4 +118,4 @@ task buildBwcVersion(type: GradleBuild) {
artifacts {
'default' file: bwcZip, name: 'x-pack', type: 'zip', builtBy: buildBwcVersion
}
}

View File

@ -56,7 +56,7 @@ task oldClusterTest(type: RestIntegTestTask) {
oldClusterTestCluster {
plugin ':x-pack-elasticsearch:plugin'
distribution = 'zip'
bwcVersion = project.bwcVersion // TODO: either randomize, or make this settable with sysprop
bwcVersion = project.wireCompatVersions[-1] // TODO: either randomize, or make this settable with sysprop
numBwcNodes = 2
numNodes = 2
clusterName = 'rolling-upgrade'