|
|
|
@ -48,7 +48,7 @@ spec:
|
|
|
|
|
userRemoteConfigs: scm.userRemoteConfigs
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
def version = sh (returnStdout: true, script: "git describe --tags --long $GIT_COMMIT").trim()
|
|
|
|
|
def version = sh (returnStdout: true, script: "git describe --tags --long --always $GIT_COMMIT").trim()
|
|
|
|
|
def gitCommit = sh (returnStdout: true, script: "git rev-parse --short $GIT_COMMIT").trim()
|
|
|
|
|
echo "Version: $version"
|
|
|
|
|
echo "Git Commit: $gitCommit"
|
|
|
|
@ -58,7 +58,7 @@ spec:
|
|
|
|
|
if (GIT_BRANCH == "main") {
|
|
|
|
|
IMAGE_TAG += "--destination $IMAGE_PUSH_DESTINATION:latest "
|
|
|
|
|
|
|
|
|
|
if(version){
|
|
|
|
|
if(version != gitCommit){
|
|
|
|
|
def parts = version.split('.')
|
|
|
|
|
if(parts.size() > 0){
|
|
|
|
|
for (int i = 0; i < parts.size(); i++) {
|
|
|
|
@ -70,7 +70,7 @@ spec:
|
|
|
|
|
} else {
|
|
|
|
|
IMAGE_TAG += "--destination $IMAGE_PUSH_DESTINATION:$GIT_BRANCH "
|
|
|
|
|
|
|
|
|
|
if(version){
|
|
|
|
|
if(version != gitCommit){
|
|
|
|
|
def parts = version.split('.')
|
|
|
|
|
if(parts.size() > 0){
|
|
|
|
|
for (int i = 0; i < parts.size(); i++) {
|
|
|
|
|