Skip to content

Commit

Permalink
Weekly triggering of nightlies? (#1553)
Browse files Browse the repository at this point in the history
* Weekly triggering of nightlies? 

Every Wednesday

* Split legacy (RHPAM, BAMOE) and new streams

* added removed property by mistake
  • Loading branch information
mareknovotny authored May 7, 2024
1 parent 96a2579 commit 22d7217
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 117 deletions.
119 changes: 2 additions & 117 deletions job-dsls/jobs/prod/prod_cron_meta_nightly_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@ def javadk=Constants.JDK_TOOL
def AGENT_LABEL="kie-rhel && kie-mem512m"

def NEXT_PRODUCT_VERSION=Constants.NEXT_PROD_VERSION
def NEXT_PRODUCT_BRANCH='7.67.x'
def NEXT_PRODUCT_CONFIG_BRANCH="rhba/${NEXT_PRODUCT_BRANCH}"
// Use again after nightly builds from main branch again
// def NEXT_RHBA_VERSION_PREFIX=Constants.RHBA_VERSION_PREFIX
def NEXT_RHBA_VERSION_PREFIX='7.67.1.redhat-'

def KOGITO_NEXT_PRODUCT_VERSION='1.13.0'
def KOGITO_NEXT_PRODUCT_BRANCH='1.13.x'
def KOGITO_NEXT_PRODUCT_CONFIG_BRANCH="kogito/${KOGITO_NEXT_PRODUCT_BRANCH}"

def OPTAPLANNER_NEXT_PRODUCT_VERSION='8.13.0'

def NEXT_BLUE_PRODUCT_VERSION=Constants.BAMOE_NEXT_PROD_VERSION
def NEXT_BLUE_PRODUCT_BRANCH='7.67.x-blue'
def NEXT_BLUE_PRODUCT_CONFIG_BRANCH="bamoe/7.67.x-blue"
def NEXT_BLUE_RHBA_VERSION_PREFIX='7.67.2.redhat-'

def KOGITO_BLUE_NEXT_PRODUCT_VERSION='1.13.2.blue'
def KOGITO_BLUE_NEXT_PRODUCT_BRANCH='1.13.x-blue'
def KOGITO_BLUE_NEXT_PRODUCT_CONFIG_BRANCH="kogito/1.13.x-blue"

def SERVERLESS_LOGIC_NEXT_PRODUCT_VERSION='999.0.0'
def SERVERLESS_LOGIC_KOGITO_NEXT_PRODUCT_VERSION=SERVERLESS_LOGIC_NEXT_PRODUCT_VERSION
Expand All @@ -42,14 +22,6 @@ def SERVERLESS_LOGIC_NEXT_PRODUCT_CONFIG_BRANCH="master"
// def SERVERLESS_LOGIC_CURRENT_PRODUCT_BRANCH='9.99.x-prod'
// def SERVERLESS_LOGIC_CURRENT_PRODUCT_CONFIG_BRANCH="openshift-serverless-logic/9.99.x"

// def RHBOP_NEXT_PRODUCT_BRANCH='main'
// def RHBOP_NEXT_PRODUCT_CONFIG_BRANCH='master'

def RHBOP_CURRENT_PRODUCT_VERSION='8.38.0'
def RHBOP_CURRENT_PRODUCT_BRANCH='8.38.x-prod'
def RHBOP_CURRENT_PRODUCT_CONFIG_BRANCH='rhbop/8.38.x'
def RHBOP_CURRENT_DROOLS_VERSION='8.29.0'

// Should be uncommented and used with kogitoWithSpecDroolsNightlyStage once Next is set for RHPAM 7.14.0 (or main)
// def DROOLS_NEXT_PRODUCT_VERSION='8.13.0'

Expand All @@ -76,23 +48,10 @@ pipeline{
// IMPORTANT: In case you trigger a new branch here, please create the same branch on build-configuration project
stages {
${rhbaNightlyStage(NEXT_PRODUCT_VERSION, NEXT_PRODUCT_BRANCH, NEXT_PRODUCT_CONFIG_BRANCH)}
${kogitoNightlyStage(KOGITO_NEXT_PRODUCT_VERSION, KOGITO_NEXT_PRODUCT_BRANCH, OPTAPLANNER_NEXT_PRODUCT_VERSION, NEXT_PRODUCT_VERSION, NEXT_RHBA_VERSION_PREFIX, KOGITO_NEXT_PRODUCT_CONFIG_BRANCH)}
// "current" prod nightlies removed, can be found in git history
// blue
${rhbaNightlyStage(NEXT_BLUE_PRODUCT_VERSION, NEXT_BLUE_PRODUCT_BRANCH, NEXT_BLUE_PRODUCT_CONFIG_BRANCH)}
${kogitoNightlyStage(KOGITO_BLUE_NEXT_PRODUCT_VERSION, KOGITO_BLUE_NEXT_PRODUCT_BRANCH, null, NEXT_BLUE_PRODUCT_VERSION, NEXT_BLUE_RHBA_VERSION_PREFIX, KOGITO_BLUE_NEXT_PRODUCT_CONFIG_BRANCH)}
// Openshift Serverless Logic
//{serverlessLogicNightlyStage(SERVERLESS_LOGIC_CURRENT_PRODUCT_BRANCH, SERVERLESS_LOGIC_CURRENT_PRODUCT_CONFIG_BRANCH, SERVERLESS_LOGIC_CURRENT_PRODUCT_VERSION, SERVERLESS_LOGIC_KOGITO_CURRENT_PRODUCT_VERSION, SERVERLESS_LOGIC_DROOLS_CURRENT_PRODUCT_VERSION)}
${serverlessLogicNightlyStage(SERVERLESS_LOGIC_NEXT_PRODUCT_BRANCH, SERVERLESS_LOGIC_NEXT_PRODUCT_CONFIG_BRANCH, SERVERLESS_LOGIC_NEXT_PRODUCT_VERSION, SERVERLESS_LOGIC_KOGITO_NEXT_PRODUCT_VERSION, SERVERLESS_LOGIC_DROOLS_NEXT_PRODUCT_VERSION)}
// RHBOP
//{rhbopNightlyStage(RHBOP_NEXT_PRODUCT_BRANCH, RHBOP_NEXT_PRODUCT_CONFIG_BRANCH)}
${rhbopNightlyStage(RHBOP_CURRENT_PRODUCT_BRANCH, RHBOP_CURRENT_PRODUCT_CONFIG_BRANCH, RHBOP_CURRENT_PRODUCT_VERSION, RHBOP_CURRENT_DROOLS_VERSION)}
// Drools Ansible Integration
${droolsAnsibleIntegrationNightlyStage(DAI_NEXT_PRODUCT_BRANCH, DAI_NEXT_PRODUCT_CONFIG_BRANCH, DAI_NEXT_PRODUCT_BRANCH, DAI_NEXT_PRODUCT_VERSION, DAI_NEXT_DROOLS_VERSION)}
${droolsAnsibleIntegrationNightlyStage(DAI_CURRENT_PRODUCT_BRANCH, DAI_CURRENT_PRODUCT_CONFIG_BRANCH, DAI_CURRENT_PRODUCT_BRANCH)}
Expand Down Expand Up @@ -129,7 +88,7 @@ pipelineJob("${folderPath}/cron-meta-nightly-pipeline") {
pipelineTriggers {
triggers {
cron{
spec("H 15 * * *")
spec("H 15 * * 0")
}
}
}
Expand All @@ -143,63 +102,6 @@ pipelineJob("${folderPath}/cron-meta-nightly-pipeline") {
}
}

String rhbaNightlyStage(String version, String branch, String configBranch) {
return """
stage('trigger RHBA nightly job ${branch}') {
steps {
build job: 'rhba.nightly/${branch}', propagate: false, wait: true, parameters: [
[\$class: 'StringParameterValue', name: 'KIE_GROUP_DEPLOYMENT_REPO_URL', value: "\${env.BXMS_QE_NEXUS}/service/local/repositories/scratch-release-rhba-${getNexusFromVersion(version)}/content-compressed"],
[\$class: 'StringParameterValue', name: 'UMB_VERSION', value: '${getUMBFromVersion(version)}'],
[\$class: 'StringParameterValue', name: 'PRODUCT_VERSION', value: "${version}"],
[\$class: 'StringParameterValue', name: 'CONFIG_BRANCH', value: "${configBranch}"],
[\$class: 'BooleanParameterValue', name: 'SKIP_TESTS', value: true]
]
}
}
"""
}

String kogitoNightlyStage(String kogitoVersion, String kogitoBranch, String optaplannerVersion, String rhbaVersion, String rhbaVersionPrefix, String configBranch) {
return """
stage('trigger KOGITO nightly job ${kogitoVersion}') {
steps {
build job: 'kogito.nightly/${kogitoBranch}', propagate: false, wait: true, parameters: [
[\$class: 'StringParameterValue', name: 'RHBA_MAVEN_REPO_URL', value: "\${env.BXMS_QE_NEXUS}/content/repositories/rhba-${getNexusFromVersion(rhbaVersion)}-nightly-with-upstream"],
[\$class: 'StringParameterValue', name: 'RHBA_VERSION_PREFIX', value: '${rhbaVersionPrefix}'],
[\$class: 'StringParameterValue', name: 'RHBA_RELEASE_VERSION', value: '${getNexusFromVersion(rhbaVersion)}'],
[\$class: 'StringParameterValue', name: 'KOGITO_DEPLOYMENT_REPO_URL', value: "\${env.BXMS_QE_NEXUS}/service/local/repositories/scratch-release-kogito-${getNexusFromVersion(kogitoVersion)}/content-compressed"],
[\$class: 'StringParameterValue', name: 'UMB_VERSION', value: '${getUMBFromVersion(kogitoVersion)}'],
[\$class: 'StringParameterValue', name: 'PRODUCT_VERSION', value: '${kogitoVersion}'],${optaplannerVersion ? """
[\$class: 'StringParameterValue', name: 'OPTAPLANNER_PRODUCT_VERSION', value: '${optaplannerVersion}'],""" : ''}
[\$class: 'StringParameterValue', name: 'CONFIG_BRANCH', value: '${configBranch}'],
[\$class: 'BooleanParameterValue', name: 'SKIP_TESTS', value: true]
]
}
}
"""
}

String kogitoWithSpecDroolsNightlyStage(String kogitoVersion, String kogitoBranch, String droolsVersion, String optaplannerVersion, String rhbaVersion, String rhbaVersionPrefix, String configBranch) {
return """
stage('trigger KOGITO nightly job ${kogitoVersion}') {
steps {
build job: 'kogito.nightly/${kogitoBranch}', propagate: false, wait: true, parameters: [
[\$class: 'StringParameterValue', name: 'RHBA_MAVEN_REPO_URL', value: 'https://bxms-qe.rhev-ci-vms.eng.rdu2.redhat.com:8443/nexus/content/repositories/rhba-${getNexusFromVersion(rhbaVersion)}-nightly-with-upstream'],
[\$class: 'StringParameterValue', name: 'RHBA_VERSION_PREFIX', value: '${rhbaVersionPrefix}'],
[\$class: 'StringParameterValue', name: 'RHBA_RELEASE_VERSION', value: '${getNexusFromVersion(rhbaVersion)}'],
[\$class: 'StringParameterValue', name: 'KOGITO_DEPLOYMENT_REPO_URL', value: 'https://bxms-qe.rhev-ci-vms.eng.rdu2.redhat.com:8443/nexus/service/local/repositories/scratch-release-kogito-${getNexusFromVersion(kogitoVersion)}/content-compressed'],
[\$class: 'StringParameterValue', name: 'UMB_VERSION', value: '${getUMBFromVersion(kogitoVersion)}'],
[\$class: 'StringParameterValue', name: 'PRODUCT_VERSION', value: '${kogitoVersion}'],
[\$class: 'StringParameterValue', name: 'DROOLS_PRODUCT_VERSION', value: '${droolsVersion}'],
[\$class: 'StringParameterValue', name: 'OPTAPLANNER_PRODUCT_VERSION', value: '${optaplannerVersion}'],
[\$class: 'StringParameterValue', name: 'CONFIG_BRANCH', value: '${configBranch}'],
[\$class: 'BooleanParameterValue', name: 'SKIP_TESTS', value: true]
]
}
}
"""
}

String serverlessLogicNightlyStage(String branch, String configBranch, String productVersion = '', String kogitoVersion = '', String droolsVersion = '') {
// when kogitoVersion or droolsVersion are empty, the Jenkins job will get them from the current branch pom (mostly main)
return """
Expand All @@ -217,23 +119,6 @@ String serverlessLogicNightlyStage(String branch, String configBranch, String pr
"""
}

String rhbopNightlyStage(String branch, String configBranch, String version = '', String droolsVersion = '') {
// when version or droolsVersion are empty, the Jenkins job will get them from the main branch pom
return """
stage('trigger RHBOP nightly job ${branch}') {
steps {
build job: 'rhbop.nightly/${branch}', propagate: false, wait: true, parameters: [
[\$class: 'StringParameterValue', name: 'KIE_GROUP_DEPLOYMENT_REPO_URL', value: 'https://bxms-qe.rhev-ci-vms.eng.rdu2.redhat.com:8443/nexus/service/local/repositories/scratch-release-rhbop-${getNexusFromVersion(version)}/content-compressed'],
[\$class: 'StringParameterValue', name: 'UMB_VERSION', value: '${getUMBFromVersion(version)}'],
[\$class: 'StringParameterValue', name: 'PRODUCT_VERSION', value: "${version}"],
[\$class: 'StringParameterValue', name: 'DROOLS_PRODUCT_VERSION', value: '${droolsVersion}'],
[\$class: 'StringParameterValue', name: 'CONFIG_BRANCH', value: "${configBranch}"],
]
}
}
"""
}

String droolsAnsibleIntegrationNightlyStage(String branch, String configBranch, String definitionFileBranch = 'main', String version = '', String droolsVersion = '') {
// when version or droolsVersion are empty, the Jenkins job will get them from the main branch pom
return """
Expand Down Expand Up @@ -275,5 +160,5 @@ String getBlueSuffix(String version, String separator) {
}

boolean isMainBranchVersion(String version) {
return [Constants.MAIN_BRANCH_PROD_VERSION, Constants.KOGITO_MAIN_BRANCH_PROD_VERSION, Constants.RHBOP_MAIN_BRANCH_PROD_VERSION].contains(version)
return [Constants.MAIN_BRANCH_PROD_VERSION, Constants.KOGITO_MAIN_BRANCH_PROD_VERSION].contains(version)
}
Loading

0 comments on commit 22d7217

Please sign in to comment.