Skip to content

Commit

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

Fix Cloud credentials reference

Remove prod jobs

Remove PR job

update pipelines (apache#1697)

PR multibranchPipelineJob (apache#1700)



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

Co-authored-by: radtriste <[email protected]>
Co-authored-by: jstastny-cz <[email protected]>
  • Loading branch information
3 people authored and rgdoliveira committed Dec 13, 2023
1 parent 5e8302e commit e85b805
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 226 deletions.
22 changes: 5 additions & 17 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

pipeline {
agent {
label 'rhel8 && !built-in'
}
tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
label 'ubuntu'
}
options {
timeout(time: 120, unit: 'MINUTES')
Expand All @@ -19,7 +15,7 @@ pipeline {

sh 'printenv'

githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'kiegroup', getChangeTarget(), true)
githubscm.checkoutIfExists(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getChangeTarget(), true)
}
}
}
Expand Down Expand Up @@ -56,7 +52,7 @@ pipeline {
}
unsuccessful {
script {
pullrequest.postComment(util.getMarkdownTestSummary(isProdCI() ? 'Prod' : 'PR', '', "${BUILD_URL}", 'GITHUB'))
pullrequest.postComment(util.getMarkdownTestSummary('PR', "${BUILD_URL}", 'GITHUB'))
}
}
}
Expand All @@ -77,7 +73,7 @@ Closure createBuildAndTestStageClosure(String image) {
buildParams.add(string(name: 'TARGET_BRANCH', value: getChangeTarget()))
buildParams.add(string(name: 'BUILD_KOGITO_APPS_REF', value: getChangeTarget()))

githubscm.prepareCommitStatusInformationForPullRequest(getRepoName(), getChangeAuthor(), getChangeBranch(), 'kiegroup', getGitAuthorCredentialsId())
githubscm.prepareCommitStatusInformationForPullRequest(getRepoName(), getChangeAuthor(), getChangeBranch(), 'apache', getGitAuthorCredentialsId())
githubscm.updateGithubCommitStatus(image, 'PENDING', 'Queued', getRepoName())

// Keep executing so we can cancel all if needed
Expand All @@ -97,15 +93,7 @@ String[] getImages() {
if (env.IMAGES_LIST) {
return env.IMAGES_LIST.split(',')
}
String listCmd = 'make list'
if (isProdCI()) {
listCmd += ' arg=--prod'
}
return util.runWithPythonVirtualEnv("${listCmd} | tr '\\n' ','", 'cekit', true).trim().split(',')
}

boolean isProdCI() {
return env.PROD_CI ? env.PROD_CI.toBoolean() : false
return sh(returnStdout: true, script: "make list | tr '\\n' ','").trim().split(',')
}

String getChangeAuthor() {
Expand Down
22 changes: 5 additions & 17 deletions .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ QUAY_REGISTRY = 'quay.io'

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 {
timeout(time: 120, unit: 'MINUTES')
}
environment {
CI = true

// Linked to node label
// Use docker due to multiplatform build
CONTAINER_ENGINE = 'docker'
Expand Down Expand Up @@ -49,11 +46,6 @@ pipeline {
}
updateGithubCommitStatus('PENDING', 'Started')

if (isProdCI()) {
// Prod fix to be able to build the image as a community one
sh "echo '' > content_sets.yaml"
}

// Login to final registry if deploy is needed
if (shouldDeployImage()) {
if (isDeployImageInOpenshiftRegistry()) {
Expand Down Expand Up @@ -253,7 +245,7 @@ String getBuiltImageTag(String imageTag = '') {
}

void runPythonCommand(String cmd, boolean stdout = false) {
return util.runWithPythonVirtualEnv(cmd, 'cekit', stdout)
return sh(returnStdout: stdout, script: cmd)
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -364,10 +356,6 @@ String getMavenArtifactRepository() {
return params.MAVEN_ARTIFACTS_REPOSITORY
}

boolean isProdCI() {
return env.PROD_CI ? Boolean.parseBoolean(env.PROD_CI) : false
}

String getQuarkusPlatformURL() {
return params.QUARKUS_PLATFORM_URL
}
Expand Down
13 changes: 5 additions & 8 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ TEST_FAILED_IMAGES = []

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

// Needed for local build
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 @@ -425,7 +422,7 @@ String[] getImages() {
}

void runPythonCommand(String cmd, boolean stdout = false) {
return util.runWithPythonVirtualEnv(cmd, 'cekit', stdout)
return sh(returnStdout: stdout, script: cmd)
}

String getQuarkusPlatformVersion() {
Expand Down
17 changes: 7 additions & 10 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@ deployProperties = [:]

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

options {
timeout(time: 120, 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}")

// Linked to node label
CONTAINER_ENGINE = 'podman'
CONTAINER_ENGINE_TLS_OPTIONS = '--tls-verify=false'
CONTAINER_ENGINE = 'docker'
CONTAINER_ENGINE_TLS_OPTIONS = ''

OPENSHIFT_API = credentials('OPENSHIFT_API')
OPENSHIFT_REGISTRY = credentials('OPENSHIFT_REGISTRY')
Expand Down Expand Up @@ -359,5 +356,5 @@ String[] getImages() {
}

void runPythonCommand(String cmd, boolean stdout = false) {
return util.runWithPythonVirtualEnv(cmd, 'cekit', stdout)
return sh(returnStdout: stdout, script: cmd)
}
21 changes: 5 additions & 16 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,18 @@ import org.jenkinsci.plugins.workflow.libs.Library

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

// Needed for local build
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 {
timeout(time: 120, 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}")

JAVA_HOME = "${GRAALVM_HOME}"
}

stages {
Expand Down Expand Up @@ -182,5 +171,5 @@ String getCleanedReleaseNotes() {
}

void runPythonCommand(String cmd, boolean stdout = false) {
return util.runWithPythonVirtualEnv(cmd, 'cekit', stdout)
return sh(returnStdout: stdout, script: cmd)
}
103 changes: 0 additions & 103 deletions .ci/jenkins/Jenkinsfile.update-prod-version

This file was deleted.

Loading

0 comments on commit e85b805

Please sign in to comment.