removes redundent 'steps' block

This commit is contained in:
Hyatt 2022-06-10 10:45:10 -05:00
parent cd1ce2f8dd
commit 0323c14c2c
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -38,31 +38,29 @@ pipeline {
stage ('Get latest Tag') { stage ('Get latest Tag') {
steps { steps {
container ('alpine') { container ('alpine') {
steps { script {
script { sh """
sh """ if ! command -v git &> /dev/null; then
if ! command -v git &> /dev/null; then apk add --no-cache git
apk add --no-cache git fi
fi """
""" k8slensVersion = "refs/tags/" . sh (
k8slensVersion = "refs/tags/" . sh ( script: """
script: """ git \
git \ -c 'versionsort.suffix=-' \
-c 'versionsort.suffix=-' \ --exit-code \
--exit-code \ --refs \
--refs \ --sort='version:refname' \
--sort='version:refname' \ --tags \
--tags \ ls-remote ssh://git@gitea.smoothnet.org:31822/nhyatt/openlens.git 'v*.*.*' \
ls-remote ssh://git@gitea.smoothnet.org:31822/nhyatt/openlens.git 'v*.*.*' \ | tail \
| tail \ --lines=1 \
--lines=1 \ | cut \
| cut \ --delimiter='/' \
--delimiter='/' \ --fields=3
--fields=3 """,
""", returnStdout: true
returnStdout: true ).trim()
).trim()
}
} }
} }
} }