adds automatic branch detection
This commit is contained in:
@ -4,7 +4,7 @@ def repository = "registry.c.test-chamber-13.lan"
|
||||
def repositoryCreds = "harbor-repository-creds"
|
||||
|
||||
def workspace
|
||||
//def k8slensVersion = "refs/tags/v5.5.1"
|
||||
def k8slensVersion
|
||||
|
||||
def label = "kubernetes-${UUID.randomUUID().toString()}"
|
||||
def templateName = "pipeline-worker"
|
||||
@ -35,6 +35,39 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage ('Get latest Tag') {
|
||||
steps {
|
||||
container ('alpine') {
|
||||
steps {
|
||||
script {
|
||||
sh """
|
||||
if ! command -v git &> /dev/null; then
|
||||
apk add --no-cache git
|
||||
fi
|
||||
"""
|
||||
k8slensVersion = "refs/tags/" . sh (
|
||||
script: """
|
||||
git \
|
||||
-c 'versionsort.suffix=-' \
|
||||
--exit-code \
|
||||
--refs \
|
||||
--sort='version:refname' \
|
||||
--tags \
|
||||
ls-remote ssh://git@gitea.smoothnet.org:31822/nhyatt/openlens.git 'v*.*.*' \
|
||||
| tail \
|
||||
--lines=1 \
|
||||
| cut \
|
||||
--delimiter='/' \
|
||||
--fields=3
|
||||
""",
|
||||
returnStdout: true
|
||||
).trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Pull K8S Lens Source Code') {
|
||||
steps {
|
||||
script {
|
||||
|
Reference in New Issue
Block a user