From dc98f0332af70ef11f42a5dccdd2b54c0a29d6e5 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 3 Sep 2024 15:20:58 -0300 Subject: [PATCH] [10.0.x] NO-ISSUE: Fix SVN upload utility function (#1246) * Fix SVN upload utility function * Add shasum func --- .../vars/releaseUtils.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy b/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy index af51530b0..bab1596be 100644 --- a/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy +++ b/jenkins-pipeline-shared-libraries/vars/releaseUtils.groovy @@ -29,7 +29,10 @@ def gpgSignFileDetachedSignatureWithPassword(String file, String signatureTarget } def gpgSignFileDetachedSignatureWithoutPassword(String file, String signatureTarget) { - sh "gpg --batch --sign --pinentry-mode=loopback --output ${signatureTarget} --detach-sig ${file}" + sh """ + gpg --batch --sign --pinentry-mode=loopback --output ${signatureTarget} --detach-sig ${file} + shasum -a 512 ${file} > ${file}.sha512 + """ } boolean gpgIsValidDetachedSignature(String file, String signature) { @@ -38,13 +41,13 @@ boolean gpgIsValidDetachedSignature(String file, String signature) { def svnUploadFileToRepository(String svnRepository, String svnCredentialsId, String releaseVersion, String... files) { withCredentials([usernamePassword(credentialsId: svnCredentialsId, usernameVariable: 'ASF_USERNAME', passwordVariable: 'ASF_PASSWORD')]) { - sh "svn co --depth=empty ${svnRepository} svn-kie" + sh "svn co --depth=empty ${svnRepository}/${releaseVersion} svn-kie" for (file in files) { - sh "cp ${file} svn-kie/${releaseVersion}/" + sh "cp ${file} svn-kie" } sh """ - svn add "svn-kie/${releaseVersion}" cd svn-kie + svn add . --force svn ci --non-interactive --no-auth-cache --username ${ASF_USERNAME} --password '${ASF_PASSWORD}' -m "Apache KIE ${releaseVersion} artifacts" rm -rf svn-kie """