Skip to content

Commit

Permalink
[apache_migration] Apache migration update (#5518)
Browse files Browse the repository at this point in the history
* updated pipelines

* Setup jenkinsfile
  • Loading branch information
radtriste authored Sep 8, 2023
1 parent 981d213 commit 8311b47
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 82 deletions.
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: '720', unit: 'MINUTES')
}
environment {
BUILDCHAIN_PROJECT = 'kiegroup/drools'
BUILDCHAIN_CONFIG_REPO = '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('kogito-pipelines', 'kiegroup', 'apache_migration', false, 'kie-ci')) // TODO to change back to kiegroup:main
pr_check_script = load 'dsl/scripts/pr_check.groovy'
}
}
}
}
stage('PR check') {
steps {
script {
dir('kogito-pipelines') {
pr_check_script.launch()
}
}
}
}
}
}
21 changes: 5 additions & 16 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,22 @@ droolsRepository = 'drools'

pipeline {
agent {
label 'ubuntu'
}

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
10 changes: 4 additions & 6 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 'ubuntu'
}

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
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 'ubuntu'
}
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 'ubuntu'
}

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 'ubuntu'
}

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
15 changes: 6 additions & 9 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void setupProjectReleaseJob() {

void setupProjectPostReleaseJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-post-release', JobType.RELEASE, "${jenkins_path_project}/Jenkinsfile.post-release", 'Drools Post Release')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

Expand Down Expand Up @@ -148,9 +148,6 @@ Map getMultijobPRConfig(JenkinsFolder jobFolder) {
], [
id: 'kogito-apps',
repository: 'kogito-apps',
env : [
NODE_OPTIONS: '--max_old_space_size=4096',
]
], [
id: 'kogito-quarkus-examples',
repository: 'kogito-examples',
Expand Down Expand Up @@ -242,7 +239,7 @@ void setupSpecificBuildChainNightlyJob(String envName, Closure defaultJobParamsG

void createSetupBranchJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'Drools Setup branch')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
REPO_NAME: 'drools',
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
Expand Down Expand Up @@ -270,7 +267,7 @@ void createSetupBranchJob() {

void setupDeployJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-deploy', jobType, "${jenkins_path}/Jenkinsfile.deploy", 'Drools Deploy')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
REPO_NAME: 'drools',
PROPERTIES_FILE_NAME: 'deployment.properties',
Expand Down Expand Up @@ -314,7 +311,7 @@ void setupDeployJob(JobType jobType) {

void setupPromoteJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Drools Promote')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
REPO_NAME: 'drools',
PROPERTIES_FILE_NAME: 'deployment.properties',
Expand Down Expand Up @@ -346,7 +343,7 @@ void setupPromoteJob(JobType jobType) {

void setupPrQuarkus3RewriteJob() {
def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'drools.rewrite', JobType.PULL_REQUEST, 'quarkus-3', "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.pr", 'Drools Quarkus 3 rewrite patch regeneration')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.jenkinsfile = "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.pr"
jobParams.pr.putAll([
run_only_for_branches: [ "${GIT_BRANCH}" ],
Expand All @@ -365,7 +362,7 @@ void setupPrQuarkus3RewriteJob() {

void setupStandaloneQuarkus3RewriteJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'drools.quarkus-3.rewrite', JobType.TOOLS, "${jenkins_path}/Jenkinsfile.quarkus-3.rewrite.standalone", 'Drools Quarkus 3 rewrite patch regeneration')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll(EnvUtils.getEnvironmentEnvVars(this, 'quarkus-3'))
jobParams.env.putAll([
AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
Expand Down
16 changes: 4 additions & 12 deletions .ci/jenkins/project/Jenkinsfile.post-release
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import org.kie.jenkins.MavenCommand

pipeline {
agent {
label 'ubuntu'
}

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 @@ -21,13 +19,7 @@ pipeline {
disableConcurrentBuilds(abortPrevious: true)
}

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

environment {
// Some generated env is also defined into .jenkins/dsl/jobs.groovy file

DROOLS_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

PR_BRANCH_HASH = "${util.generateHash(10)}"
Expand Down
6 changes: 0 additions & 6 deletions .ci/jenkins/project/Jenkinsfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ pipeline {
label 'ubuntu'
}

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

environment {
// Some generated env is also defined into ./dsl/jobs.groovy file

DROOLS_CI_EMAIL = credentials("${JENKINS_EMAIL_CREDS_ID}")
}

Expand Down
7 changes: 0 additions & 7 deletions .ci/jenkins/project/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ JOBS = [:]
FAILED_STAGES = [:]
UNSTABLE_STAGES = [:]

// Should be multibranch pipeline
pipeline {
agent {
label 'ubuntu'
Expand All @@ -20,13 +19,7 @@ pipeline {
timeout(time: 360, unit: 'MINUTES')
}

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

environment {
// Some generated env is also defined into ./dsl/jobs.groovy file

DROOLS_CI_EMAIL = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Use branch name in nightly tag as we may have parallel main and release branch builds
Expand Down

0 comments on commit 8311b47

Please sign in to comment.