mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
This upgrade required a few significant changes. Firstly, the build scan plugin has been renamed, and changed to be a Settings plugin rather than a project plugin so the declaration of this has moved to our settings.gradle file. Second, we were using a rather old version of the Nebula ospackage plugin for building deb and rpm packages, the migration to the latest version required some updates to get things working as expected as we had some workarounds in place that are no longer applicable with the latest bug fixes. (cherry picked from commit 87f9c16e2f8870e3091062cde37b43042c3ae1c5)
49 lines
1.6 KiB
Groovy
49 lines
1.6 KiB
Groovy
import java.nio.file.Files
|
|
|
|
String buildNumber = System.getenv('BUILD_NUMBER')
|
|
|
|
if (buildNumber) {
|
|
File uploadFile = file("build/${buildNumber}.tar.bz2")
|
|
project.gradle.buildFinished { result ->
|
|
println "build complete, generating: $uploadFile"
|
|
if (uploadFile.exists()) {
|
|
project.delete(uploadFile)
|
|
}
|
|
|
|
try {
|
|
ant.tar(destfile: uploadFile, compression: "bzip2", longfile: "gnu") {
|
|
fileset(dir: projectDir) {
|
|
Set<File> fileSet = fileTree(projectDir) {
|
|
include("**/*.hprof")
|
|
include("**/reaper.log")
|
|
include("**/build/testclusters/**")
|
|
exclude("**/build/testclusters/**/data/**")
|
|
exclude("**/build/testclusters/**/distro/**")
|
|
exclude("**/build/testclusters/**/repo/**")
|
|
exclude("**/build/testclusters/**/extract/**")
|
|
}
|
|
.files
|
|
.findAll { Files.isRegularFile(it.toPath()) }
|
|
|
|
if (fileSet.empty) {
|
|
// In cases where we don't match any workspace files, exclude everything
|
|
ant.exclude(name: "**/*")
|
|
} else {
|
|
fileSet.each {
|
|
ant.include(name: projectDir.toPath().relativize(it.toPath()))
|
|
}
|
|
}
|
|
}
|
|
|
|
fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) {
|
|
include(name: "**/daemon-${ProcessHandle.current().pid()}*.log")
|
|
}
|
|
|
|
fileset(dir: "${gradle.gradleUserHomeDir}/workers", followsymlinks: false)
|
|
}
|
|
} catch (Exception e) {
|
|
logger.lifecycle("Failed to archive additional logs", e)
|
|
}
|
|
}
|
|
}
|