Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions .ci/jenkins/Jenkinsfile.prod.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,20 @@ pipeline {
env.MANAGEMENT_CONSOLE_REGISTRY = ''
env.OPERATOR_REGISTRY = ''

// Override SONATAFLOW_QUARKUS_DEVUI_VERSION in image manifest - modules/kogito-project-versions/module.yaml
sh """sed -i "s/### SET ME DURING BUILD PROCESS ###/${env.ARTIFACTS_VERSION}/g" ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""
// Override KOGITO_VERSION in image manifest - modules/kogito-project-versions/module.yaml
// Inital overrides for shared modules YAML descriptors in /images-dist/modules/


// Override all occurenes of 999-SNAPSHOT in images-dist/modules/kogito-project-versions/module.yaml
// This version must be changed to match java artifacts build in previous steps
sh """sed -i "s/999-SNAPSHOT/${env.ARTIFACTS_VERSION}/g" ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""
// Override QUARKUS_PLATFORM_VERSION in image manifest - modules/kogito-project-versions/module.yaml
sh """sed -i "s/${env.QUARKUS_VERSION_COMMUNITY}/${env.QUARKUS_PLATFORM_VERSION}/g" ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""
// Override QUARKUS_PLATFORM_GROUPID in image manifest - modules/kogito-project-versions/module.yaml

// Override QUARKUS_PLATFORM_VERSION in images-dist/modules/kogito-project-versions/module.yaml
sh """sed -i '/name: "QUARKUS_PLATFORM_VERSION"/{n;s/value: "[^"]*"/value: "${env.QUARKUS_PLATFORM_VERSION}"/;}' ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""

// Override QUARKUS_VERSION in images-dist/modules/kogito-project-versions/module.yaml
sh """sed -i '/name: "QUARKUS_VERSION"/{n;s/value: "[^"]*"/value: "${env.QUARKUS_VERSION}"/;}' ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""

// Override QUARKUS_PLATFORM_GROUPID in images-dist/modules/kogito-project-versions/module.yaml
sh """sed -i "s/io.quarkus.platform/com.redhat.quarkus.platform/g" ${env.IMAGES_KOGITO_PROJECT_VERSIONS_MODULE_PATH}"""
}
}
Expand Down Expand Up @@ -458,13 +465,18 @@ def buildOperator(String descriptorFile, String nightlyBranchName, String operat
// Create a different folder for operator, otherwise dir() will mess up with folders and impact other steps of pipeline
sh "cp -rp ${operatorDescriptorRepository} ${env.WORKSPACE}/operator_repo"
dir("${env.WORKSPACE}/operator_repo") {
println "Building operator"
println "=== Building Logic Operator ==="

// Replace branch and ref and version in descriptor file
// Replace branch property in descriptor file so it points to nightly build config
sh """sed -i "s/branch:.*/branch: ${nightlyBranchName}/g" ${descriptorFile}"""

// Parse latest commit of operator git repository and replace the ref in descriptor file
def reference = sh(returnStdout: true, script: "cd ${operatorCodeRepository};git rev-parse HEAD").trim()
sh """sed -i "s/ref:.*/ref: ${reference}/g" ${descriptorFile}"""

// Replace version property in descriptor file so the final image origins can be identified
sh """sed -i "s/ version:.*/ version: 999.0.0.nightly/g" ${descriptorFile}"""

println "Diff of ${descriptorFile} after replacing branch name and ref"
sh "git diff ${descriptorFile}"

Expand All @@ -486,13 +498,18 @@ def buildImage(String imageName, String descriptorFilePath, String nightlyBranch
def imageFolder = descriptorFilePath.substring(0, descriptorFilePath.lastIndexOf('/'))
sh "cp -rp ${imagesRepository}/${imageFolder} ${env.WORKSPACE}/${imageName}_repo"
dir("${env.WORKSPACE}/${imageName}_repo") {
println "Building image ${imageName}"
println "=== Building container image ${imageName} ==="

def descriptorFile = descriptorFilePath.substring(descriptorFilePath.lastIndexOf('/') + 1, descriptorFilePath.size())

// Replace branch property in descriptor file so it points to nightly build config
sh """sed -i "s/branch:.*/branch: ${nightlyBranchName}/g" ${descriptorFile}"""

// Replace 999-SNAPSHOT in label "org.kie.kogito.version" to match already build logic maven artifacts
sh """sed -i "s/999-SNAPSHOT/${env.ARTIFACTS_VERSION}/g" ${descriptorFile}"""

println "Diff of ${descriptorFile} after replacing branch name and org.kie.kogito.version"
sh "git diff ${descriptorFile}"
sh "git diff --no-index ${imagesRepository}/${imageFolder}/${descriptorFile} ./${descriptorFile}"

println 'Using cekit version'
util.runWithPythonVirtualEnv('cekit --version', 'cekit')
Expand Down