Skip to content

Commit

Permalink
chore: add git tag to
Browse files Browse the repository at this point in the history
  • Loading branch information
annleefores committed Nov 28, 2023
1 parent 0d69acd commit dd1a7f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion server/codepod/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,22 @@ pipeline {
}
}

stage('get tag') {
steps{
script {
def codepodVersion = sh(script: "git tag -l 'kodiko-backend-*' --sort='-version:refname' | head -n1 | awk -F'-' '{print \$3}'", returnStdout: true).trim()
echo "Current tag: ${codepodVersion}"

// Set the version as an environment variable
env.VERSION = codepodVersion

}
}
}

stage('build and push') {
environment {
DOCKER_IMAGE = "annleefores/kodiko-codepod:${BUILD_NUMBER}-${GIT_COMMIT}"
DOCKER_IMAGE = "annleefores/kodiko-codepod:${VERSION}"
}
steps{
container('kaniko') {
Expand Down

0 comments on commit dd1a7f9

Please sign in to comment.