Build now downloads c++ dist for all platforms

Original commit: elastic/x-pack-elasticsearch@8fd9850377
This commit is contained in:
Colin Goodheart-Smithe 2016-12-02 09:45:54 +00:00
parent 1e5a12fc6a
commit 00dc347217
2 changed files with 15 additions and 7 deletions

View File

@ -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)
}
}

View File

@ -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'
}