From 3122037d60b11c0cc635baaaf576e8acd17eb4dd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 17 Nov 2018 23:09:52 +0000 Subject: [PATCH] Create a publishable artifact list; Create a checksum list --- checksum/utils.groovy | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/checksum/utils.groovy b/checksum/utils.groovy index 8829198..ef80fdd 100644 --- a/checksum/utils.groovy +++ b/checksum/utils.groovy @@ -4,9 +4,14 @@ env.CHECKSUMARTIFACTS = "checksums/**" // SHA256SUM environment variable must be set to sha256sum utility // Generate a checksum file of from a list of files/directories relative to workspace def generatelist(checksummable) { - def sha256sumfound = true - if (!fileExists("${SHA256SUM}")) { - sha256sumfound = false + def sha256sumfound = false + if (env.SHA256SUM) { + if (fileExists("${SHA256SUM}")) { + sha256sumfound = true + } + } + if (!sha256sumfound) + { if (isUnix()) { def sha256sumpath = sh(returnStdout: true, script: 'which sha256sum').trim() if (sha256sumpath) { @@ -15,9 +20,9 @@ def generatelist(checksummable) { sha256sumfound = true } } - if (!sha256sumfound) { - error "Please define the path to a sha256sum utility in the SHA256SUM environment variable" - } + } + if (!sha256sumfound) { + error "Please define the path to a sha256sum utility in the SHA256SUM environment variable" } def CHECKSUMFOLDER = "${WORKSPACE}/checksums" sh """