|
@@ -68,19 +68,11 @@ if (enabled) {
|
|
commandLine = ['git', 'clone', rootDir, checkoutDir]
|
|
commandLine = ['git', 'clone', rootDir, checkoutDir]
|
|
}
|
|
}
|
|
|
|
|
|
- // we use regular Exec here to ensure we always get output, regardless of logging level
|
|
|
|
- task findUpstream(type: Exec) {
|
|
|
|
|
|
+ task findUpstream(type: LoggedExec) {
|
|
dependsOn createClone
|
|
dependsOn createClone
|
|
workingDir = checkoutDir
|
|
workingDir = checkoutDir
|
|
commandLine = ['git', 'remote', '-v']
|
|
commandLine = ['git', 'remote', '-v']
|
|
- ignoreExitValue = true
|
|
|
|
- ByteArrayOutputStream output = new ByteArrayOutputStream()
|
|
|
|
- standardOutput = output
|
|
|
|
doLast {
|
|
doLast {
|
|
- if (execResult.exitValue != 0) {
|
|
|
|
- output.toString('UTF-8').eachLine { line -> logger.error(line) }
|
|
|
|
- execResult.assertNormalExitValue()
|
|
|
|
- }
|
|
|
|
project.ext.upstreamExists = false
|
|
project.ext.upstreamExists = false
|
|
output.toString('UTF-8').eachLine {
|
|
output.toString('UTF-8').eachLine {
|
|
if (it.contains("upstream")) {
|
|
if (it.contains("upstream")) {
|
|
@@ -104,13 +96,15 @@ if (enabled) {
|
|
commandLine = ['git', 'fetch', '--all']
|
|
commandLine = ['git', 'fetch', '--all']
|
|
}
|
|
}
|
|
|
|
|
|
- // this is an Exec task so that the SHA that is checked out is logged
|
|
|
|
String buildMetadataKey = "bwc_refspec_${project.path.substring(1)}"
|
|
String buildMetadataKey = "bwc_refspec_${project.path.substring(1)}"
|
|
- task checkoutBwcBranch(type: Exec) {
|
|
|
|
- def String refspec = System.getProperty("tests.bwc.refspec", buildMetadata.get(buildMetadataKey, "upstream/${bwcBranch}"))
|
|
|
|
|
|
+ task checkoutBwcBranch(type: LoggedExec) {
|
|
|
|
+ String refspec = System.getProperty("tests.bwc.refspec", buildMetadata.get(buildMetadataKey, "upstream/${bwcBranch}"))
|
|
dependsOn fetchLatest
|
|
dependsOn fetchLatest
|
|
workingDir = checkoutDir
|
|
workingDir = checkoutDir
|
|
commandLine = ['git', 'checkout', refspec]
|
|
commandLine = ['git', 'checkout', refspec]
|
|
|
|
+ doFirst {
|
|
|
|
+ println "Checking out elasticsearch ${refspec} for branch ${bwcBranch}"
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
File buildMetadataFile = project.file("build/${project.name}/build_metadata")
|
|
File buildMetadataFile = project.file("build/${project.name}/build_metadata")
|
|
@@ -127,7 +121,9 @@ if (enabled) {
|
|
execResult.assertNormalExitValue()
|
|
execResult.assertNormalExitValue()
|
|
}
|
|
}
|
|
project.mkdir(buildMetadataFile.parent)
|
|
project.mkdir(buildMetadataFile.parent)
|
|
- buildMetadataFile.setText("${buildMetadataKey}=${output.toString('UTF-8')}", 'UTF-8')
|
|
|
|
|
|
+ String commit = output.toString('UTF-8')
|
|
|
|
+ buildMetadataFile.setText("${buildMetadataKey}=${commit}", 'UTF-8')
|
|
|
|
+ println "Checked out elasticsearch commit ${commit}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -148,7 +144,6 @@ if (enabled) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
artifacts {
|
|
artifacts {
|
|
'default' file: bwcDeb, name: 'elasticsearch', type: 'deb', builtBy: buildBwcVersion
|
|
'default' file: bwcDeb, name: 'elasticsearch', type: 'deb', builtBy: buildBwcVersion
|
|
'default' file: bwcRpm, name: 'elasticsearch', type: 'rpm', builtBy: buildBwcVersion
|
|
'default' file: bwcRpm, name: 'elasticsearch', type: 'rpm', builtBy: buildBwcVersion
|