Skip to content

Commit

Permalink
kie-issues#574 Initial ASF Jenkins CI Setup
Browse files Browse the repository at this point in the history
Prepare for Apache migration

update

Remove PR job

updated dsl config

correct dsl config

[apache_migration] Apache migration update (#5518)

* updated pipelines

* Setup jenkinsfile

corrected dsl

Fix CI

update config

Disable kie-jpmml-integration

As not migrated for now

PR multibranchPipelineJob (#5523)

Co-authored-by: jstastny-cz <[email protected]>

Update `kiegroup` repository references to `apache` (#5519)

still use apache_migration branch in apache (#5526)

Co-authored-by: jstastny-cz <[email protected]>

Fix CI references to kie-docs and kie-benchmarks (#5527)

Co-authored-by: jstastny-cz <[email protected]>

Switch to main branch in config
  • Loading branch information
radtriste authored and jstastny-cz committed Sep 19, 2023
1 parent 72edd96 commit c4333ee
Show file tree
Hide file tree
Showing 24 changed files with 227 additions and 332 deletions.
22 changes: 11 additions & 11 deletions .ci/buildchain-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ default:
docker system prune -f
build:
- project: kiegroup/drools
- project: apache/incubator-kie-drools
build-command:
current: |
export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.DROOLS_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
mvn clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.DROOLS_BUILD_MVN_OPTS }}
upstream: |
mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.DROOLS_BUILD_MVN_OPTS_UPSTREAM }}
- project: kiegroup/kogito-runtimes
- project: apache/incubator-kie-kogito-runtimes
build-command:
current: |
export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_RUNTIMES_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
mvn clean ${{ env.MVN_CMD }} -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS }}
upstream: |
mvn clean install -Dquickly -Dfull ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_RUNTIMES_BUILD_MVN_OPTS_UPSTREAM }}
- project: kiegroup/kogito-apps
- project: apache/incubator-kie-kogito-apps
build-command:
current: |
export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KOGITO_APPS_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
Expand All @@ -57,7 +57,7 @@ build:
**/cypress/screenshots/**
**/cypress/videos/**
- project: kiegroup/kogito-examples
- project: apache/incubator-kie-kogito-examples
build-command:
# First install the main pom
# Then build the required submodule pom
Expand All @@ -68,10 +68,10 @@ build:
upstream: |
mvn clean install -DskipTests -DskipITs ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS_UPSTREAM }}
- project: kiegroup/kie-jpmml-integration
build-command:
current: |
export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KIE_JPMML_INTEGRATION_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
mvn clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KIE_JPMML_INTEGRATION_BUILD_MVN_OPTS }}
upstream: |
mvn clean install -DskipTests ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KIE_JPMML_INTEGRATION_BUILD_MVN_OPTS_UPSTREAM }}
# - project: kiegroup/kie-jpmml-integration
# build-command:
# current: |
# export MVN_CMD=`bash -c "if [ '${{ env.ENABLE_DEPLOY }}' = 'true' ]; then printf 'deploy ${{ env.DEPLOY_MVN_OPTS }} ${{ env.KIE_JPMML_INTEGRATION_DEPLOY_MVN_OPTS }}'; else printf 'install'; fi"`
# mvn clean ${{ env.MVN_CMD }} ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.KIE_JPMML_INTEGRATION_BUILD_MVN_OPTS }}
# upstream: |
# mvn clean install -DskipTests ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.KIE_JPMML_INTEGRATION_BUILD_MVN_OPTS_UPSTREAM }}
38 changes: 19 additions & 19 deletions .ci/buildchain-project-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: "2.1"
dependencies:
- project: kiegroup/drools
- project: apache/incubator-kie-drools
mapping:
dependencies:
default:
Expand All @@ -10,12 +10,12 @@ dependencies:
default:
- source: (\d*)\.(.*)
targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)/g, (m, n1, n2) => `${+n1+7}.${n2}`)"
exclude:
- kiegroup/kie-jpmml-integration
# exclude:
# - kiegroup/kie-jpmml-integration

- project: kiegroup/kogito-runtimes
- project: apache/incubator-kie-kogito-runtimes
dependencies:
- project: kiegroup/drools
- project: apache/incubator-kie-drools
mapping:
dependencies:
default:
Expand All @@ -26,12 +26,12 @@ dependencies:
- source: (\d*)\.(.*)
targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)/g, (m, n1, n2) => `${+n1-7}.${n2}`)"
exclude:
- kiegroup/kogito-examples
- kiegroup/kogito-apps
- apache/incubator-kie-kogito-examples
- apache/incubator-kie-kogito-apps

- project: kiegroup/kogito-apps
- project: apache/incubator-kie-kogito-apps
dependencies:
- project: kiegroup/kogito-runtimes
- project: apache/incubator-kie-kogito-runtimes
mapping:
dependencies:
default:
Expand All @@ -42,13 +42,13 @@ dependencies:
- source: (\d*)\.(.*)
targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)/g, (m, n1, n2) => `${+n1-7}.${n2}`)"
exclude:
- kiegroup/kogito-examples
- kiegroup/kogito-runtimes
- apache/incubator-kie-kogito-examples
- apache/incubator-kie-kogito-runtimes

- project: kiegroup/kogito-examples
- project: apache/incubator-kie-kogito-examples
dependencies:
- project: kiegroup/kogito-runtimes
- project: kiegroup/kogito-apps
- project: apache/incubator-kie-kogito-runtimes
- project: apache/incubator-kie-kogito-apps
mapping:
dependencies:
default:
Expand All @@ -59,10 +59,10 @@ dependencies:
- source: (\d*)\.(.*)
targetExpression: "process.env.GITHUB_BASE_REF.replace(/(\\d*)\\.(.*)/g, (m, n1, n2) => `${+n1-7}.${n2}`)"
exclude:
- kiegroup/kogito-apps
- kiegroup/kogito-runtimes
- apache/incubator-kie-kogito-apps
- apache/incubator-kie-kogito-runtimes

- project: kiegroup/kie-jpmml-integration
dependencies:
- project: kiegroup/drools
# - project: kiegroup/kie-jpmml-integration
# dependencies:
# - project: apache/incubator-kie-drools
# no mapping needed
2 changes: 1 addition & 1 deletion .ci/environments/common/update_quarkus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

mvn_cmd="mvn ${BUILD_MVN_OPTS:-} ${BUILD_MVN_OPTS_QUARKUS_UPDATE:-}"

source <(curl -s https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh)
source <(curl -s https://raw.githubusercontent.com/apache/incubator-kie-kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh)

echo "Update project with Quarkus version ${QUARKUS_VERSION}"

Expand Down
2 changes: 1 addition & 1 deletion .ci/environments/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ if [ -f "${env_path}/after.sh" ]; then
fi

# Download `setup_integration_branch` script and execute
curl -s https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/setup_integration_branch.sh | bash
curl -s https://raw.githubusercontent.com/apache/incubator-kie-kogito-pipelines/main/dsl/seed/scripts/setup_integration_branch.sh | bash
43 changes: 43 additions & 0 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@Library('jenkins-pipeline-shared-libraries')_

pr_check_script = null

pipeline {
agent {
label 'ubuntu'
}
options {
timestamps()
timeout(time: 360, unit: 'MINUTES')
}
environment {
BUILDCHAIN_PROJECT = 'apache/incubator-kie-drools'
BUILDCHAIN_CONFIG_REPO = 'incubator-kie-drools'
BUILDCHAIN_CONFIG_FILE_PATH = '.ci/buildchain-config.yaml'

ENABLE_SONARCLOUD = 'true'
DROOLS_BUILD_MVN_OPTS = '-Prun-code-coverage'
}
stages {
stage('Initialize') {
steps {
script {
// load `pr_check.groovy` file from kogito-pipelines:main
dir('kogito-pipelines') {
checkout(githubscm.resolveRepository('incubator-kie-kogito-pipelines', 'apache', 'main', false, 'ASF_Cloudbees_Jenkins_ci-builds'))
pr_check_script = load 'dsl/scripts/pr_check.groovy'
}
}
}
}
stage('PR check') {
steps {
script {
dir('kogito-pipelines') {
pr_check_script.launch()
}
}
}
}
}
}
25 changes: 6 additions & 19 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,24 @@ import org.kie.jenkins.MavenStagingHelper

deployProperties = [:]

droolsRepository = 'drools'

pipeline {
agent {
label 'kie-rhel8 && docker && kie-mem16g && !built-in'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
timestamps()
timeout(time: 180, unit: 'MINUTES')
}

// parameters {
// For parameters, check into ./dsl/jobs.groovy file
// }

environment {
// Static env is defined into ./dsl/jobs.groovy file

DROOLS_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Keep here for visitibility
MAVEN_OPTS = '-Xms1024m -Xmx4g'

PR_BRANCH_HASH = "${util.generateHash(10)}"
MAVEN_DEPLOY_LOCAL_DIR = "${WORKSPACE}/maven_deploy_dir"
MAVEN_DEPLOY_LOCAL_DIR = "/tmp/maven_deploy_dir"
}

stages {
Expand Down Expand Up @@ -220,7 +207,7 @@ boolean shouldStageArtifacts() {
}

boolean shouldDeployToRepository() {
return env.MAVEN_DEPLOY_REPOSITORY || getGitAuthor() == 'kiegroup'
return env.MAVEN_DEPLOY_REPOSITORY || getGitAuthor() == 'apache'
}

boolean isRelease() {
Expand Down
12 changes: 5 additions & 7 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ pipelineProperties = [:]

pipeline {
agent {
label 'kie-rhel8 && docker && !built-in'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand Down Expand Up @@ -222,7 +220,7 @@ void uploadFileMgmt(String directory) {
}

boolean isNotTestingBuild() {
return getGitAuthor() == 'kiegroup'
return getGitAuthor() == 'apache'
}

boolean isMainStream() {
Expand Down
9 changes: 4 additions & 5 deletions .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ changeBranch = env.ghprbSourceBranch ?: CHANGE_BRANCH

pipeline {
agent {
label 'kie-rhel8 && kie-mem16g && !built-in'
}
tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}
options {
timestamps()
Expand Down
10 changes: 4 additions & 6 deletions .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ previousHash = ''

pipeline {
agent {
label 'kie-rhel8 && kie-mem16g && !built-in'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand Down
19 changes: 4 additions & 15 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,20 @@ import org.kie.jenkins.MavenCommand

pipeline {
agent {
label 'kie-rhel8 && !built-in'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
timestamps()
timeout(time: 60, unit: 'MINUTES')
}

// parameters {
// For parameters, check into ./dsl/jobs.groovy file
// }

environment {
// Static env is defined into ./dsl/jobs.groovy file

DROOLS_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Keep here for visitibility
MAVEN_OPTS = '-Xms1024m -Xmx4g'

BRANCH_HASH = "${util.generateHash(10)}"
}

Expand Down
Loading

0 comments on commit c4333ee

Please sign in to comment.