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:
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -116,10 +116,11 @@ pipeline {
|
|||||||
stage("Uploading packages to repo form ${NativeArchNormalized}") {
|
stage("Uploading packages to repo form ${NativeArchNormalized}") {
|
||||||
withCredentials([usernamePassword(credentialsId: 'GiteaPKGPUploadAuth', usernameVariable: 'UploadUsername', passwordVariable: 'UploadPassword')]) {
|
withCredentials([usernamePassword(credentialsId: 'GiteaPKGPUploadAuth', usernameVariable: 'UploadUsername', passwordVariable: 'UploadPassword')]) {
|
||||||
sh '''
|
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');
|
for apkFile in $(find -L ~/packages -name '*.apk');
|
||||||
do
|
do
|
||||||
echo "Uploading $apkFile"
|
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;
|
done;
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user