From e9789ce0b52c24b129e130d71071068fe24120ed Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 24 Jan 2024 01:38:49 +0100 Subject: [PATCH] Added OS version detection if upload with jenkinsfile Replaced static Alpine version from upload url with the one from /etc/os-release --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0dffc7d..c25984c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -116,10 +116,11 @@ pipeline { stage("Uploading packages to repo form ${NativeArchNormalized}") { withCredentials([usernamePassword(credentialsId: 'GiteaPKGPUploadAuth', usernameVariable: 'UploadUsername', passwordVariable: 'UploadPassword')]) { sh ''' + AlpineRelease=v$(awk -F= '$1=="VERSION_ID" { print $2 ;}' /etc/os-release | cut -d"." -f 1,2) for apkFile in $(find -L ~/packages -name '*.apk'); do echo "Uploading $apkFile" - curl --user $UploadUsername:$UploadPassword --upload-file $apkFile https://git.bprieshof.nl/api/packages/brammp/alpine/v3.18/pkgs + curl --user $UploadUsername:$UploadPassword --upload-file $apkFile https://git.bprieshof.nl/api/packages/brammp/alpine/$AlpineRelease/pkgs done; ''' }