This is an automated email from the ASF dual-hosted git repository.
Kusuma04-dev pushed a commit to branch test_10.3.x
in repository https://gitbox.apache.org/repos/asf/incubator-kie.git
The following commit(s) were added to refs/heads/test_10.3.x by this push:
new ccd2f619516 tests
ccd2f619516 is described below
commit ccd2f619516ca193edcbe0891fa553dda3978398
Author: Kusuma <[email protected]>
AuthorDate: Tue Oct 13 15:43:51 2026 +0530
tests
---
.ci/incubator-kie-ci-build.Dockerfile | 74 +++++++++++++++++++++
.ci/jenkins/Jenkinsfile.103xplus.deploy | 51 ++-------------
.ci/jenkins/Jenkinsfile.103xplus.promote | 40 +-----------
.ci/jenkins/Jenkinsfile.ci-image-build | 106 +++++++++++++++++++++++++++++++
4 files changed, 185 insertions(+), 86 deletions(-)
diff --git a/.ci/incubator-kie-ci-build.Dockerfile
b/.ci/incubator-kie-ci-build.Dockerfile
new file mode 100644
index 00000000000..af35bdc27ab
--- /dev/null
+++ b/.ci/incubator-kie-ci-build.Dockerfile
@@ -0,0 +1,74 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# CI builder image for incubator-kie (Drools) Jenkins jobs.
+# Published per stream by .ci/jenkins/Jenkinsfile.ci-image-build, e.g.
+# docker.io/apache/incubator-kie-ci-build:10.3.x
+#
+# Keep SDKMAN_MAVEN in sync with <version.org.apache.maven> in
kie-parent/pom.xml
+# (enforced by maven-enforcer-plugin, rule requireMavenVersion).
+FROM cruizba/ubuntu-dind:jammy-26.1.4
+
+SHELL ["/bin/bash", "-c"]
+
+ARG SDKMAN_JAVA="17.0.11-tem"
+ARG SDKMAN_MAVEN="3.9.16"
+
+ENV LANG='C.UTF-8'
+
+RUN apt-get update && apt-get upgrade -y && apt-get install -y
--no-install-recommends \
+ sudo bash wget curl gpg ca-certificates \
+ git findutils tar gzip unzip zip jq fontconfig \
+ && apt-get clean autoclean && apt-get autoremove --yes \
+ && rm -rf /var/lib/apt/lists/*
+
+# gh cli (used by the shared pipeline libraries for GitHub operations)
+RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg |
dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
+ && chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
+ && echo "deb [arch=$(dpkg --print-architecture)
signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg]
https://cli.github.com/packages stable main" >
/etc/apt/sources.list.d/github-cli.list \
+ && apt-get update && apt-get install -y gh \
+ && rm -rf /var/lib/apt/lists/*
+
+# User setup (non-root)
+RUN groupadd -g 910 nonrootuser && useradd --create-home -u 910 -g 910 -s
/bin/bash nonrootuser && \
+ echo "nonrootuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+
+# Docker user setup (non-root)
+RUN groupadd docker && usermod -aG docker nonrootuser
+
+USER nonrootuser
+
+# Java and Maven setup
+RUN curl -s "https://get.sdkman.io" | bash && \
+ source "$HOME/.sdkman/bin/sdkman-init.sh" && \
+ sdk install java ${SDKMAN_JAVA} && \
+ sudo update-alternatives --install /usr/local/bin/java java $(which java)
1 && \
+ sdk install maven ${SDKMAN_MAVEN} && \
+ sudo update-alternatives --install /usr/local/bin/mvn mvn $(which mvn) 1
&& \
+ sdk flush
+
+# Env vars
+ENV HOME="/home/nonrootuser"
+ENV JAVA_HOME="${HOME}/.sdkman/candidates/java/current/"
+ENV MAVEN_HOME="${HOME}/.sdkman/candidates/maven/current/"
+ENV MAVEN_OPTS="-Xms1024m -Xmx12g"
+
+ENTRYPOINT [""]
+
+CMD ["bash"]
diff --git a/.ci/jenkins/Jenkinsfile.103xplus.deploy
b/.ci/jenkins/Jenkinsfile.103xplus.deploy
index 42323d18bb1..2630455e66b 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.deploy
+++ b/.ci/jenkins/Jenkinsfile.103xplus.deploy
@@ -80,16 +80,6 @@ pipeline {
}
}
- stage('Setup Maven') {
- // The CI agent image may ship an older Maven than the one
kie-parent's enforcer
- // requires (version.org.apache.maven). Install the required
version into the workspace.
- steps {
- script {
- installMaven()
- }
- }
- }
-
stage('Prepare for PR') {
when {
expression { return isCreatePr() }
@@ -291,48 +281,15 @@ void setDeployPropertyIfNeeded(String key, def value) {
}
}
-void installMaven() {
- // Fallback only used if the version can't be read from kie-parent
- def mavenVersion = '3.9.16'
- def pomFile = "${getRepoName()}/kie-parent/pom.xml"
- if (fileExists(pomFile)) {
- def pomVersion = sh(returnStdout: true, script: "grep -o
'<version.org.apache.maven>[^<]*' ${pomFile} | head -1 | cut -d'>' -f2").trim()
- if (pomVersion) {
- mavenVersion = pomVersion
- }
- }
- echo "Installing Maven ${mavenVersion}"
-
- withEnv(["MAVEN_VERSION=${mavenVersion}"]) {
- sh '''#!/usr/bin/env bash
- set -euo pipefail
- INSTALL_DIR="${WORKSPACE}/.tools"
- MAVEN_DIR="${INSTALL_DIR}/apache-maven-${MAVEN_VERSION}"
- if [ ! -x "${MAVEN_DIR}/bin/mvn" ]; then
- ARCHIVE="apache-maven-${MAVEN_VERSION}-bin.tar.gz"
-
BASE_URL="https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}"
- mkdir -p "${INSTALL_DIR}"
- curl -fsSL --retry 5 -o "${INSTALL_DIR}/${ARCHIVE}"
"${BASE_URL}/${ARCHIVE}"
- curl -fsSL --retry 5 -o "${INSTALL_DIR}/${ARCHIVE}.sha512"
"${BASE_URL}/${ARCHIVE}.sha512"
- echo "$(cut -d' ' -f1 "${INSTALL_DIR}/${ARCHIVE}.sha512")
${INSTALL_DIR}/${ARCHIVE}" | sha512sum -c -
- tar -xzf "${INSTALL_DIR}/${ARCHIVE}" -C "${INSTALL_DIR}"
- rm -f "${INSTALL_DIR}/${ARCHIVE}"
"${INSTALL_DIR}/${ARCHIVE}.sha512"
- fi
- '''
- }
-
- env.MAVEN_HOME = "${env.WORKSPACE}/.tools/apache-maven-${mavenVersion}"
- env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"
- sh 'mvn -version'
-}
-
-MavenCommand getMavenCommand() {
+MavenCommand getMavenCommand(String directory = '') {
+ directory = directory ?: getRepoName()
def mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
+ .inDirectory(directory)
.withProperty('full')
return mvnCmd
}
String getGitTagName() {
return params.GIT_TAG_NAME
-}
+}
\ No newline at end of file
diff --git a/.ci/jenkins/Jenkinsfile.103xplus.promote
b/.ci/jenkins/Jenkinsfile.103xplus.promote
index 7f2cecb28f5..42fe1efc6ed 100644
--- a/.ci/jenkins/Jenkinsfile.103xplus.promote
+++ b/.ci/jenkins/Jenkinsfile.103xplus.promote
@@ -136,7 +136,6 @@ pipeline {
}
steps {
script {
- installMaven()
configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
getMavenCommand()
.withOptions(env.DROOLS_BUILD_MVN_OPTS ? [
env.DROOLS_BUILD_MVN_OPTS ] : [])
@@ -273,43 +272,6 @@ void tagLatest() {
}
}
-void installMaven() {
- // The CI agent image may ship an older Maven than the one kie-parent's
enforcer
- // requires (version.org.apache.maven). Install the required version into
the workspace.
- // Fallback only used if the version can't be read from kie-parent
- def mavenVersion = '3.9.16'
- def pomFile = "${getRepoName()}/kie-parent/pom.xml"
- if (fileExists(pomFile)) {
- def pomVersion = sh(returnStdout: true, script: "grep -o
'<version.org.apache.maven>[^<]*' ${pomFile} | head -1 | cut -d'>' -f2").trim()
- if (pomVersion) {
- mavenVersion = pomVersion
- }
- }
- echo "Installing Maven ${mavenVersion}"
-
- withEnv(["MAVEN_VERSION=${mavenVersion}"]) {
- sh '''#!/usr/bin/env bash
- set -euo pipefail
- INSTALL_DIR="${WORKSPACE}/.tools"
- MAVEN_DIR="${INSTALL_DIR}/apache-maven-${MAVEN_VERSION}"
- if [ ! -x "${MAVEN_DIR}/bin/mvn" ]; then
- ARCHIVE="apache-maven-${MAVEN_VERSION}-bin.tar.gz"
-
BASE_URL="https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}"
- mkdir -p "${INSTALL_DIR}"
- curl -fsSL --retry 5 -o "${INSTALL_DIR}/${ARCHIVE}"
"${BASE_URL}/${ARCHIVE}"
- curl -fsSL --retry 5 -o "${INSTALL_DIR}/${ARCHIVE}.sha512"
"${BASE_URL}/${ARCHIVE}.sha512"
- echo "$(cut -d' ' -f1 "${INSTALL_DIR}/${ARCHIVE}.sha512")
${INSTALL_DIR}/${ARCHIVE}" | sha512sum -c -
- tar -xzf "${INSTALL_DIR}/${ARCHIVE}" -C "${INSTALL_DIR}"
- rm -f "${INSTALL_DIR}/${ARCHIVE}"
"${INSTALL_DIR}/${ARCHIVE}.sha512"
- fi
- '''
- }
-
- env.MAVEN_HOME = "${env.WORKSPACE}/.tools/apache-maven-${mavenVersion}"
- env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"
- sh 'mvn -version'
-}
-
MavenCommand getMavenCommand() {
mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] :
[])
@@ -338,4 +300,4 @@ boolean isNotTestingBuild() {
boolean isMainStream() {
return env.DROOLS_STREAM == 'main'
-}
+}
\ No newline at end of file
diff --git a/.ci/jenkins/Jenkinsfile.ci-image-build
b/.ci/jenkins/Jenkinsfile.ci-image-build
new file mode 100644
index 00000000000..d17e5761d19
--- /dev/null
+++ b/.ci/jenkins/Jenkinsfile.ci-image-build
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Builds and publishes the CI builder image from
.ci/incubator-kie-ci-build.Dockerfile.
+// One tag per stream (e.g. main, 10.3.x, 10.4.x): set IMAGE_TAG to the stream
name.
+// Then point the jobs' AGENT_DOCKER_BUILDER_IMAGE to
+// docker.io/apache/incubator-kie-ci-build:<IMAGE_TAG>
+
+pipeline {
+ agent {
+ label 'ubuntu'
+ }
+
+ parameters {
+ string(name: 'IMAGE_TAG', defaultValue: "${env.BRANCH_NAME}",
description: 'Image tag, one per stream, e.g. 10.3.x', trim: true)
+ }
+
+ environment {
+ DOCKER_CONFIG = "${WORKSPACE}/.docker"
+ IMAGE_REGISTRY = 'docker.io'
+ IMAGE_ACCOUNT = 'apache'
+ IMAGE_NAME = 'incubator-kie-ci-build'
+ DOCKERHUB_USER_CREDS_ID = 'DOCKERHUB_USER'
+ DOCKERHUB_TOKEN_CREDS_ID = 'DOCKERHUB_TOKEN'
+ }
+
+ options {
+ timestamps()
+ timeout(time: 120, unit: 'MINUTES')
+ }
+
+ stages {
+ stage('Initialize') {
+ steps {
+ script {
+ assert params.IMAGE_TAG : 'IMAGE_TAG parameter is
mandatory'
+ env.FULL_IMAGE =
"${env.IMAGE_REGISTRY}/${env.IMAGE_ACCOUNT}/${env.IMAGE_NAME}:${params.IMAGE_TAG}"
+ currentBuild.displayName = params.IMAGE_TAG
+ }
+ cleanWs(deleteDirs: true, disableDeferredWipeout: true)
+ }
+ }
+
+ stage('Checkout') {
+ steps {
+ dir('kie') {
+ checkout scm
+ }
+ }
+ }
+
+ stage('Build image') {
+ steps {
+ dir('kie') {
+ sh "docker build -t ${env.FULL_IMAGE} -f
.ci/incubator-kie-ci-build.Dockerfile ."
+ }
+ }
+ }
+
+ stage('Test built image') {
+ steps {
+ // Test before pushing so a broken image is never published.
+ sh """#!/bin/bash -el
+ docker run --rm ${env.FULL_IMAGE} bash -lc 'java -version
&& mvn --version && git --version && gh --version'
+ """.trim()
+ }
+ }
+
+ stage('Push image to registry') {
+ steps {
+ withCredentials([
+ string(credentialsId: env.DOCKERHUB_USER_CREDS_ID,
variable: 'REGISTRY_USER'),
+ string(credentialsId: env.DOCKERHUB_TOKEN_CREDS_ID,
variable: 'REGISTRY_TOKEN')
+ ]) {
+ sh '''#!/bin/bash -e
+ echo "${REGISTRY_TOKEN}" | docker login -u
"${REGISTRY_USER}" --password-stdin "${IMAGE_REGISTRY}"
+ docker push "${FULL_IMAGE}"
+ docker logout "${IMAGE_REGISTRY}"
+ '''
+ }
+ }
+ }
+ }
+
+ post {
+ always {
+ cleanWs(deleteDirs: true)
+ }
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]