Skip to content

Commit

Permalink
feat: new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjeev committed Sep 10, 2024
1 parent dd79d5e commit cdaa15f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
33 changes: 21 additions & 12 deletions Jenkinsfile-Release
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ pipeline {

stages {

stage("Check for Git Tag") {
steps {
script {
def tag = sh(returnStdout: true, script: "git tag --contains").trim()

if (tag != null) {
env.GIT_TAG = tag
} else {
env.GIT_TAG = ''
}
echo "GIT_TAG is set to: ${env.GIT_TAG}"
}
}
}

stage('Setup') {
steps {
script {
Expand All @@ -23,26 +38,20 @@ pipeline {
}

stage('Create Release') {
when {
expression {
return env.GIT_TAG == "" // Only run if GIT_TAG is not set
}
}
steps {
script {
def tag = sh(returnStdout: true, script: "poetry run semantic-release version").trim()
echo "${tag}"

sh "poetry run semantic-release publish"

if (tag != null) {
env.GIT_TAG = tag
} else {
env.GIT_TAG = ''
}

if (env.GIT_TAG == '') {
error("Failed to determine new tag or commit from semantic-release output.")
}

env.IMAGE_TAG_RELEASE = "${IMAGE_NAME}:${GIT_TAG}"

echo "Published new tag: ${env.GIT_TAG}"
echo "Published new tag: ${tag}"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</style>
</head>
<body>
<h1>Todo App: v10</h1>
<h1>Todo App: v12</h1>

<!-- Add Task Form -->
<form method="post">
Expand Down

0 comments on commit cdaa15f

Please sign in to comment.