Skip to content

Commit

Permalink
Timeout on buildkite uploads but don't fail the build
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Oct 22, 2024
1 parent 5f74f30 commit ade82f2
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import java.nio.file.Files
import java.util.concurrent.TimeUnit

String buildNumber = System.getenv('BUILD_NUMBER') ?: System.getenv('BUILDKITE_BUILD_NUMBER')
Boolean isNested = System.getProperty("scan.tag.NESTED") != null
Expand Down Expand Up @@ -68,9 +69,13 @@ if (buildNumber && isNested == false) {
if (uploadFile.exists() && System.getenv("BUILDKITE") == "true") {
try {
println "Uploading buildkite artifact: ${uploadFilePath}..."
new ProcessBuilder("buildkite-agent", "artifact", "upload", uploadFilePath)
.start()
.waitFor()
try {
new ProcessBuilder("buildkite-agent", "artifact", "upload", uploadFilePath)
.start()
.waitFor(30, TimeUnit.MINUTES)
} catch (InterruptedException e) {
System.out.println("Failed to upload buildkite artifact " + e.getMessage());
}

println "Generating buildscan link for artifact..."

Expand Down

0 comments on commit ade82f2

Please sign in to comment.