From 980738203a490f0e37c3f47f6b2cfdabbe9d9f08 Mon Sep 17 00:00:00 2001 From: radtriste Date: Thu, 17 Aug 2023 15:52:43 +0200 Subject: [PATCH] KOGITO-9725 DSL cleanup: Remove 'kogito-bdd' check Never used/maintained --- .ci/jenkins/dsl/jobs.groovy | 68 +++++++++++-------------------------- 1 file changed, 20 insertions(+), 48 deletions(-) diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index de465d95b9..375c7d8a4e 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -68,7 +68,6 @@ List getExamplesBuildMvnOptions(JenkinsFolder jobFolder) { // PR checks KogitoJobUtils.createAllEnvironmentsPerRepoPRJobs(this) { jobFolder -> getMultijobPRConfig(jobFolder) } -setupDeployJob(JobType.PULL_REQUEST, 'kogito-bdd') // Init branch createSetupBranchJob() @@ -88,8 +87,8 @@ setupNightlyQuarkusIntegrationJob('quarkus-lts', nightlyJobParamsGetter) setupNightlyQuarkusIntegrationJob('native-lts', nightlyJobParamsGetter) // Release jobs -setupDeployJob(JobType.RELEASE) -setupPromoteJob(JobType.RELEASE) +setupReleaseDeployJob() +setupReleasePromoteJob() setupPostReleaseJob() if (isMainStream()) { @@ -143,61 +142,34 @@ void createSetupBranchJob() { } } -/* -* Setup deploy job -* when using `isForPr` property, then git branch/author information are parameters instead of env -* as we want in that case more dynamic git retrieval -* also we set a specific repository for the pr checks -*/ -void setupDeployJob(JobType jobType, String envName = '') { - def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'kogito-examples-deploy', jobType, envName, "${jenkins_path}/Jenkinsfile.deploy", 'Kogito Examples Deploy') +void setupReleaseDeployJob() { + def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-examples-deploy', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.deploy", 'Kogito Examples Deploy') JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) - if (jobType == JobType.PULL_REQUEST) { - jobParams.git.branch = '${BUILD_BRANCH_NAME}' - jobParams.git.author = '${GIT_AUTHOR}' - jobParams.git.project_url = Utils.createProjectUrl("${GIT_AUTHOR_NAME}", jobParams.git.repository) - } jobParams.env.putAll([ PROPERTIES_FILE_NAME: 'deployment.properties', JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}", + + GIT_AUTHOR: "${GIT_AUTHOR_NAME}", + + AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", + GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}", + MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}", + MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", + MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}", + MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}", + + NEXUS_RELEASE_URL: "${MAVEN_NEXUS_RELEASE_URL}", + NEXUS_RELEASE_REPOSITORY_ID: "${MAVEN_NEXUS_RELEASE_REPOSITORY}", + NEXUS_STAGING_PROFILE_ID: "${MAVEN_NEXUS_STAGING_PROFILE_ID}", + NEXUS_BUILD_PROMOTION_PROFILE_ID: "${MAVEN_NEXUS_BUILD_PROMOTION_PROFILE_ID}", ]) - if (jobType == JobType.PULL_REQUEST) { - jobParams.env.putAll([ - MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_PR_CHECKS_REPOSITORY_URL}", - MAVEN_DEPLOY_REPOSITORY: "${MAVEN_PR_CHECKS_REPOSITORY_URL}", - MAVEN_REPO_CREDS_ID: "${MAVEN_PR_CHECKS_REPOSITORY_CREDS_ID}", - ]) - } else { - jobParams.env.putAll([ - GIT_AUTHOR: "${GIT_AUTHOR_NAME}", - - AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}", - GITHUB_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}", - - MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}", - MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}", - MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}", - ]) - if (jobType == JobType.RELEASE) { - jobParams.env.putAll([ - NEXUS_RELEASE_URL: "${MAVEN_NEXUS_RELEASE_URL}", - NEXUS_RELEASE_REPOSITORY_ID: "${MAVEN_NEXUS_RELEASE_REPOSITORY}", - NEXUS_STAGING_PROFILE_ID: "${MAVEN_NEXUS_STAGING_PROFILE_ID}", - NEXUS_BUILD_PROMOTION_PROFILE_ID: "${MAVEN_NEXUS_BUILD_PROMOTION_PROFILE_ID}", - ]) - } - } KogitoJobTemplate.createPipelineJob(this, jobParams)?.with { parameters { stringParam('DISPLAY_NAME', '', 'Setup a specific build display name') stringParam('BUILD_BRANCH_NAME', "${GIT_BRANCH}", 'Set the Git branch to checkout') - if (jobType == JobType.PULL_REQUEST) { - // author can be changed as param only for PR behavior, due to source branch/target, else it is considered as an env - stringParam('GIT_AUTHOR', "${GIT_AUTHOR_NAME}", 'Set the Git author to checkout') - } booleanParam('SKIP_TESTS', false, 'Skip tests') @@ -212,8 +184,8 @@ void setupDeployJob(JobType jobType, String envName = '') { } } -void setupPromoteJob(JobType jobType) { - def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-examples-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Kogito Examples Promote') +void setupReleasePromoteJob() { + def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-examples-promote', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.promote", 'Kogito Examples Promote') JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams) jobParams.env.putAll([ PROPERTIES_FILE_NAME: 'deployment.properties',