Skip to content

Commit

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

deactivate PR checks

Prepare for Apache migration

update

Remove PR job

[apache_migration] Apache migration update (#1876)

* Setup Jenkinsfile

* update pipelines

Fix CI

PR multibranchPipelineJob (#1879)

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

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

Co-authored-by: radtriste <[email protected]>
  • Loading branch information
jstastny-cz and radtriste authored Sep 19, 2023
1 parent cb9f921 commit e2962d2
Show file tree
Hide file tree
Showing 15 changed files with 112 additions and 109 deletions.
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 @@ -44,4 +44,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
41 changes: 41 additions & 0 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@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-kogito-apps'

ENABLE_SONARCLOUD = 'true'
KOGITO_APPS_BUILD_MVN_OPTS = '-Dvalidate-formatting -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()
}
}
}
}
}
}
26 changes: 6 additions & 20 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ deployProperties = [:]

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 {
Expand All @@ -30,12 +28,8 @@ pipeline {

KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Keep here for visitibility
MAVEN_OPTS = '-Xms1024m -Xmx4g'
NODE_OPTIONS = '--max_old_space_size=4096'

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

stages {
Expand All @@ -61,8 +55,6 @@ pipeline {
dir(getRepoName()) {
checkoutRepo()
}

setupCypressEnv('12.17.0')
}
}
post {
Expand Down Expand Up @@ -190,12 +182,6 @@ pipeline {
}
}

void setupCypressEnv(String cypressVersion) {
if (env.CYPRESS_BINARY_URL) {
env.CYPRESS_INSTALL_BINARY = "${CYPRESS_BINARY_URL}/cypress-${cypressVersion}.zip"
}
}

void sendNotification() {
if (params.SEND_NOTIFICATION) {
mailer.sendMarkdownTestSummaryNotification('Deploy', "[${getBuildBranch()}] Kogito Apps", [env.KOGITO_CI_EMAIL_TO])
Expand Down Expand Up @@ -239,7 +225,7 @@ boolean shouldStageArtifacts() {
}

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

boolean isRelease() {
Expand Down
24 changes: 11 additions & 13 deletions .ci/jenkins/Jenkinsfile.optaplanner
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@

import org.kie.jenkins.MavenCommand

droolsRepo = 'drools'
optaplannerRepo = 'optaplanner'
kogitoRuntimesRepo = 'kogito-runtimes'
kogitoAppsRepo = 'kogito-apps'
droolsRepo = 'incubator-kie-drools'
optaplannerRepo = 'incubator-kie-optaplanner'
kogitoRuntimesRepo = 'incubator-kie-kogito-runtimes'
kogitoAppsRepo = 'incubator-kie-kogito-apps'

pipeline {
agent {
label 'kie-rhel8 && docker && kie-mem16g'
}
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: 360, unit: 'MINUTES')
}
environment {
KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")
MAVEN_OPTS = '-Xms1024m -Xmx6g'
}
stages {
stage('Initialize') {
Expand Down Expand Up @@ -84,7 +82,7 @@ pipeline {
.withProperty('skipUI')
.withProperty('maven.test.failure.ignore', true)
.withProperty('version.org.optaplanner', env.OPTAPLANNER_VERSION)
.withProperty('optaplanner') // Use specific profile https://github.com/kiegroup/kogito-apps/blob/48a5c8f9a905a2c17b9d0e01cee744902a4824f0/pom.xml#L63
.withProperty('optaplanner') // Use specific profile https://github.com/apache/incubator-kie-kogito-apps/blob/48a5c8f9a905a2c17b9d0e01cee744902a4824f0/pom.xml#L63
.run('clean install')
}
}
Expand Down Expand Up @@ -134,7 +132,7 @@ void checkoutDroolsRepo() {

void checkoutOptaplannerRepo() {
dir(optaplannerRepo) {
checkout(githubscm.resolveRepository(optaplannerRepo, 'kiegroup', getOptaPlannerBranch(), false))
checkout(githubscm.resolveRepository(optaplannerRepo, 'apache', getOptaPlannerBranch(), false))
}
}

Expand Down Expand Up @@ -169,7 +167,7 @@ String getOptaPlannerBranch() {

MavenCommand getMavenCommand(String directory) {
return new MavenCommand(this, ['-fae', '-ntp'])
.withSettingsXmlId('kogito_release_settings')
.withSettingsXmlId('kie-release-settings')
.withProperty('java.net.preferIPv4Stack', true)
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
.inDirectory(directory)
Expand Down
7 changes: 4 additions & 3 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ pipelineProperties = [:]

pipeline {
agent {
label 'rhel8 && !built-in'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand All @@ -16,8 +19,6 @@ pipeline {

environment {
KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

NODE_OPTIONS = '--max_old_space_size=4096'
}

stages {
Expand Down
13 changes: 6 additions & 7 deletions .ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ changeTarget = env.ghprbTargetBranch ?: CHANGE_TARGET

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 All @@ -38,9 +37,9 @@ pipeline {
stage('Build upstream projects') {
steps {
script {
[ 'drools', 'kogito-runtimes' ].each { project ->
[ 'incubator-kie-drools', 'incubator-kie-kogito-runtimes' ].each { project ->
dir(project) {
githubscm.checkoutIfExists(project, changeAuthor, changeBranch, 'kiegroup', changeTarget, true)
githubscm.checkoutIfExists(project, changeAuthor, changeBranch, 'apache', changeTarget, true)
sh '.ci/environments/update.sh quarkus-3'
getMavenCommand().withProperty('quickly').run('clean install')
}
Expand Down
12 changes: 5 additions & 7 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 Expand Up @@ -57,7 +55,7 @@ pipeline {
stage('Build upstream projects') {
steps {
script {
[ 'drools', 'kogito-runtimes' ].each { project ->
[ 'incubator-kie-drools', 'incubator-kie-kogito-runtimes' ].each { project ->
dir(project) {
githubscm.checkoutIfExists(project, getGitAuthor(), getBuildBranch(), getBaseAuthor(), getBaseBranch(), true)
sh '.ci/environments/update.sh quarkus-3'
Expand Down
23 changes: 6 additions & 17 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,24 @@ import org.jenkinsci.plugins.workflow.libs.Library

import org.kie.jenkins.MavenCommand

droolsRepo = 'drools'
kogitoRuntimesRepo = 'kogito-runtimes'
droolsRepo = 'incubator-kie-drools'
kogitoRuntimesRepo = 'incubator-kie-kogito-runtimes'

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

KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

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

stages {
Expand Down
Loading

0 comments on commit e2962d2

Please sign in to comment.