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') {
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()
}
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()
}
}
}