From ba4e3d66e58049307cdb6fa9cd004e046d9adc27 Mon Sep 17 00:00:00 2001 From: Tristan Radisson Date: Fri, 4 Aug 2023 15:03:05 +0200 Subject: [PATCH] Revert "Correct deploy pipeline (#3145)" This reverts commit 9a18a585282ac337760f0b8569f313c5fcd689ea. --- .ci/jenkins/Jenkinsfile.deploy | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 879e2a7af0f..947a1ce5a57 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -98,7 +98,7 @@ pipeline { // Need artifacts available locally getMavenCommand().withProperty('quickly').run('clean install') - maven.mvnSetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), 'data-index-ephemeral.image', getDataIndexEphemeralReleaseImage()) + maven.mvnSetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), "data-index-ephemeral.image", "${getNextProdImage()}" ) } } } @@ -106,17 +106,12 @@ pipeline { steps { script { dir(getRepoName()) { - def mvnCmd = getMavenCommand() + String mvnCmd = getMavenCommand() .withProperty('maven.test.failure.ignore', true) - - if (params.SKIP_TESTS) { - mvnCmd.skipTests() // Conflict somehow with Python testing. If `skipTests={anyvalue}` is set, then exec plugin is not executed ... - } - if (isRelease()) { - // Use nightly image for testing as the released one does not exist yet ... - mvnCmd.withProperty('data-index-ephemeral.image', getDataIndexEphemeralNightlyImage()) - } - util.runWithPythonVirtualEnv(mvnCmd.getFullRunCommand('clean install'), 'swf') + .withProfiles(['full']) + .skipTests(params.SKIP_TESTS) + .getFullRunCommand('clean install') + util.runWithPythonVirtualEnv(mvnCmd, 'swf') } } } @@ -298,7 +293,7 @@ MavenCommand getMavenCommand(String directory = '') { void runMavenDeploy(boolean localDeployment = false) { mvnCmd = getMavenCommand() - if (localDeployment) { + if(localDeployment) { mvnCmd.withLocalDeployFolder(getLocalDeploymentFolder()) } else if (env.MAVEN_DEPLOY_REPOSITORY) { mvnCmd.withDeployRepository(env.MAVEN_DEPLOY_REPOSITORY) @@ -331,10 +326,13 @@ String getWorkflowCommonDeploymentPath() { return "${getRepoName()}/quarkus/extensions/kogito-quarkus-workflow-extension-common/kogito-quarkus-workflow-common-deployment" } -String getDataIndexEphemeralNightlyImage() { - return "quay.io/kiegroup/kogito-data-index-ephemeral-nightly:${util.getMajorMinorVersion(getProjectVersion())}" +String getCurrentNightlyImage() { + return maven.mvnGetVersionProperty(getMavenCommand(getWorkflowCommonDeploymentPath()), "data-index-ephemeral.image") } -String getDataIndexEphemeralReleaseImage() { - return "quay.io/kiegroup/kogito-data-index-ephemeral:${util.getMajorMinorVersion(getProjectVersion())}" +String getNextProdImage() { + def currentNightlyImage = getCurrentNightlyImage() + def nightlyIndex = currentNightlyImage.indexOf('-nightly') + def nextProdImageName = currentNightlyImage.substring(0, nightlyIndex) + currentNightlyImage.substring(nightlyIndex + '-nightly'.length()) + return nextProdImageName }