Skip to content

Commit 1305733

Browse files
radtristeradtriste
andauthored
Correct deploy pipeline (#3145)
* Correct deploy pipeline * updated skipTests --------- Co-authored-by: radtriste <[email protected]>
1 parent 7cae73f commit 1305733

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.ci/jenkins/Jenkinsfile.deploy

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,25 @@ pipeline {
9898

9999
// Need artifacts available locally
100100
getMavenCommand().withProperty('quickly').run('clean install')
101-
maven.mvnSetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), "data-index-ephemeral.image", "${getNextProdImage()}" )
101+
maven.mvnSetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), 'data-index-ephemeral.image', getDataIndexEphemeralReleaseImage())
102102
}
103103
}
104104
}
105105
stage('Build & Test') {
106106
steps {
107107
script {
108108
dir(getRepoName()) {
109-
String mvnCmd = getMavenCommand()
109+
def mvnCmd = getMavenCommand()
110110
.withProperty('maven.test.failure.ignore', true)
111-
.withProfiles(['full'])
112-
.skipTests(params.SKIP_TESTS)
113-
.getFullRunCommand('clean install')
114-
util.runWithPythonVirtualEnv(mvnCmd, 'swf')
111+
112+
if (params.SKIP_TESTS) {
113+
mvnCmd.skipTests() // Conflict somehow with Python testing. If `skipTests={anyvalue}` is set, then exec plugin is not executed ...
114+
}
115+
if (isRelease()) {
116+
// Use nightly image for testing as the released one does not exist yet ...
117+
mvnCmd.withProperty('data-index-ephemeral.image', getDataIndexEphemeralNightlyImage())
118+
}
119+
util.runWithPythonVirtualEnv(mvnCmd.getFullRunCommand('clean install'), 'swf')
115120
}
116121
}
117122
}
@@ -302,7 +307,7 @@ MavenCommand getMavenCommand(String directory = '') {
302307
void runMavenDeploy(boolean localDeployment = false) {
303308
mvnCmd = getMavenCommand()
304309

305-
if(localDeployment) {
310+
if (localDeployment) {
306311
mvnCmd.withLocalDeployFolder(getLocalDeploymentFolder())
307312
} else if (env.MAVEN_DEPLOY_REPOSITORY) {
308313
mvnCmd.withDeployRepository(env.MAVEN_DEPLOY_REPOSITORY)
@@ -335,13 +340,10 @@ String getWorkflowCommonDeploymentPath() {
335340
return "${getRepoName()}/quarkus/extensions/kogito-quarkus-workflow-extension-common/kogito-quarkus-workflow-common-deployment"
336341
}
337342

338-
String getCurrentNightlyImage() {
339-
return maven.mvnGetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), "data-index-ephemeral.image")
343+
String getDataIndexEphemeralNightlyImage() {
344+
return "quay.io/kiegroup/kogito-data-index-ephemeral-nightly:${util.getMajorMinorVersion(getProjectVersion())}"
340345
}
341346

342-
String getNextProdImage() {
343-
def currentNightlyImage = getCurrentNightlyImage()
344-
def nightlyIndex = currentNightlyImage.indexOf('-nightly')
345-
def nextProdImageName = currentNightlyImage.substring(0, nightlyIndex) + currentNightlyImage.substring(nightlyIndex + '-nightly'.length())
346-
return nextProdImageName
347+
String getDataIndexEphemeralReleaseImage() {
348+
return "quay.io/kiegroup/kogito-data-index-ephemeral:${util.getMajorMinorVersion(getProjectVersion())}"
347349
}

0 commit comments

Comments
 (0)