Skip to content

Commit

Permalink
kie-issues#1252: Configure tagVersion programmatically for `data-inde…
Browse files Browse the repository at this point in the history
…x-ephemeral` image. (#3529)

* New property to configure only the tagVersion

* Change CI
  • Loading branch information
tiagobento authored May 23, 2024
1 parent edbfc64 commit 1267dff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 5 additions & 9 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.jenkinsci.plugins.workflow.libs.Library
import org.kie.jenkins.MavenCommand

droolsRepo = 'incubator-kie-drools'
dataIndexEphemeralImageName = 'docker.io/apache/incubator-kie-kogito-data-index-ephemeral'

pipeline {
agent {
Expand Down Expand Up @@ -98,8 +97,8 @@ pipeline {
getMavenCommand(getRepoName())
.withOptions(['-pl :kogito-quarkus-workflow-common-deployment'])
.withSettingsXmlFile(MAVEN_SETTINGS_FILE),
'data-index-ephemeral.image',
getDataIndexEphemeralImage()
'data-index-ephemeral.image.tagVersion',
getDataIndexEphemeralImageTagVersion()
)
}
}
Expand Down Expand Up @@ -199,13 +198,10 @@ String getWorkflowCommonDeploymentRelativePath() {
return 'quarkus/extensions/kogito-quarkus-workflow-extension-common/kogito-quarkus-workflow-common-deployment'
}

String getDataIndexEphemeralImage() {
if (isMainBranch()) {
return "${dataIndexEphemeralImageName}:main"
}
String getDataIndexEphemeralImageTagVersion() {
String version = getKogitoVersion()
if (version.endsWith('-SNAPSHOT')) {
return "${dataIndexEphemeralImageName}:${util.getMajorMinorVersion(version)}"
return getBuildBranch() // E.g., `main` or `10.0.x`
}
return "${dataIndexEphemeralImageName}:${util.getMajorMinorVersion(version)}"
return util.getMajorMinorVersion(version) // E.g., `10.0`
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
<name>Kogito :: Quarkus Workflow Extension Common :: Deployment</name>

<properties>
<data-index-ephemeral.image>docker.io/apache/incubator-kie-kogito-data-index-ephemeral:main</data-index-ephemeral.image>
<data-index-ephemeral.image.tagVersion>main</data-index-ephemeral.image.tagVersion>
<data-index-ephemeral.image>docker.io/apache/incubator-kie-kogito-data-index-ephemeral:${data-index-ephemeral.image.tagVersion}</data-index-ephemeral.image>
<java.module.name>org.kie.kogito.quarkus.workflow.deployment</java.module.name>
</properties>

Expand Down

0 comments on commit 1267dff

Please sign in to comment.