Allow to change bwc refspec in xpack (elastic/x-pack-elasticsearch#2311)
Today it's impossible to run xpack bwc tests against any other branch
or remote than upstream. This allows to pass `-Dtests.bwc.refspec` to
change the refspec to use for the bwc tests.
Original commit: elastic/x-pack-elasticsearch@a4a6b12f47c3d8b53a66ba70ac0cd47948451dbd
@@ -120,25 +120,27 @@ subprojects {
task fetchElasticsearchLatest(type: LoggedExec) {
dependsOn addElasticsearchUpstream
workingDir = esCheckoutDir
- commandLine = ['git', 'fetch', 'upstream']
+ commandLine = ['git', 'fetch', '--all']
}
task fetchXPackLatest(type: LoggedExec) {
dependsOn addXPackUpstream
workingDir = xpackCheckoutDir
- commandLine = ['git', 'fetch', 'upstream']
+ commandLine = ['git', 'fetch', '--all']
}
task checkoutElasticsearchBwcBranch(type: LoggedExec) {
dependsOn fetchElasticsearchLatest
+ def String refspec = System.getProperty("tests.bwc.refspec", "upstream/${bwcBranch}")
workingDir = esCheckoutDir
- commandLine = ['git', 'checkout', "upstream/${bwcBranch}"]
+ commandLine = ['git', 'checkout', refspec]
}
task checkoutXPackBwcBranch(type: LoggedExec) {
dependsOn fetchXPackLatest
+ def String refspec = System.getProperty("tests.bwc.refspec", "upstream/${bwcBranch}")
workingDir = xpackCheckoutDir
- commandLine = ['git', 'checkout', "upstream/${bwcBranch}"]
+ commandLine = ['git', 'checkout', refspec]
}
File bwcZip = file("${xpackCheckoutDir}/plugin/build/distributions/x-pack-${bwcVersion}.zip")
