Build now downloads c++ dist for all platforms
Original commit: elastic/x-pack-elasticsearch@8fd9850377
This commit is contained in:
parent
1e5a12fc6a
commit
00dc347217
|
@ -72,15 +72,19 @@ class DownloadS3Task extends DefaultTask {
|
|||
|
||||
/** Download a single file */
|
||||
private void downloadFile(AmazonS3Client client, ProgressLogger progressLogger, File destDir, String key) {
|
||||
File destPath = getDestinationPath(destDir, key, flatten)
|
||||
logger.info("Downloading ${destPath} from ${bucket}")
|
||||
progressLogger.progress("downloading ${destPath}")
|
||||
client.getObject(new GetObjectRequest(bucket, key), destPath)
|
||||
}
|
||||
|
||||
private File getDestinationPath(File destDir, String key, boolean flatten) {
|
||||
String destPath
|
||||
if (flatten) {
|
||||
destPath = key.substring(key.lastIndexOf('/') + 1)
|
||||
} else {
|
||||
destPath = key
|
||||
}
|
||||
logger.info("Downloading ${destPath} from ${bucket}")
|
||||
progressLogger.progress("downloading ${destPath}")
|
||||
client.getObject(new GetObjectRequest(bucket, key),
|
||||
new File(destDir, destPath))
|
||||
return new File(destDir, destPath)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,8 +46,12 @@ task downloadCppDist(type: DownloadS3Task) {
|
|||
bucket 'prelert-artifacts'
|
||||
destDir file("${buildDir}/cppDist")
|
||||
flatten true
|
||||
download "maven/${project.group}/prelert-cpp/${elasticsearchVersion}/prelert-cpp-darwin-x86_64-${elasticsearchVersion}.zip"
|
||||
download "maven/${project.group}/prelert-cpp/${elasticsearchVersion}/prelert-cpp-windows-x86_64-${elasticsearchVersion}.zip"
|
||||
download "maven/${project.group}/prelert-cpp/${elasticsearchVersion}/prelert-cpp-linux-x86_64-${elasticsearchVersion}.zip"
|
||||
download "maven/${project.group}/prelert-cpp/${elasticsearchVersion}/prelert-cpp-darwin-x86_64-${elasticsearchVersion}.zip"
|
||||
outputs.file(file("${buildDir}/cppDist/prelert-cpp-windows-x86_64-${elasticsearchVersion}.zip"))
|
||||
outputs.file(file("${buildDir}/cppDist/prelert-cpp-darwin-x86_64-${elasticsearchVersion}.zip"))
|
||||
outputs.file(file("${buildDir}/cppDist/prelert-cpp-linux-x86_64-${elasticsearchVersion}.zip"))
|
||||
}
|
||||
|
||||
bundlePlugin {
|
||||
|
@ -55,8 +59,8 @@ bundlePlugin {
|
|||
from { zipTree(project(':cpp').buildZip.outputs.files.singleFile) }
|
||||
dependsOn ':cpp:buildZip'
|
||||
} else {
|
||||
for (file in downloadCppDist.outputs.files) {
|
||||
from{ zipTree(file) }
|
||||
for (outputFile in downloadCppDist.outputs.files) {
|
||||
from(zipTree(outputFile))
|
||||
}
|
||||
dependsOn 'downloadCppDist'
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue