Added OS version detection if upload with jenkinsfile

Replaced static Alpine version from upload url with the one from /etc/os-release
This commit is contained in:
2024-01-24 01:38:49 +01:00
parent 3a2cb51921
commit e9789ce0b5

3
Jenkinsfile vendored
View File

@@ -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;
'''
}