Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-9725 DSL cleanup: Remove 'kogito-bdd' check #1839

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 19 additions & 43 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ boolean isNative(JenkinsFolder jobFolder) {
return EnvUtils.hasEnvironmentId(this, jobFolder.getEnvironmentName(), 'native')
}

setupDeployJob(JobType.PULL_REQUEST, 'kogito-bdd')

// PR checks
KogitoJobUtils.createAllEnvironmentsPerRepoPRJobs(this) { jobFolder -> getMultijobPRConfig(jobFolder) }

Expand Down Expand Up @@ -121,8 +119,8 @@ setupNightlyQuarkusIntegrationJob('quarkus-lts', nightlyJobParamsGetter)
setupNightlyQuarkusIntegrationJob('native-lts', nightlyJobParamsGetter)

// Release jobs
setupDeployJob(JobType.RELEASE)
setupPromoteJob(JobType.RELEASE)
setupReleaseDeployJob()
setupReleasePromoteJob()

// Update Optaplanner tools job
if (isMainStream()) {
Expand Down Expand Up @@ -197,53 +195,31 @@ void createSetupBranchJob() {
}
}

void setupDeployJob(JobType jobType, String envName = '') {
def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'kogito-apps-deploy', jobType, envName, "${jenkins_path}/Jenkinsfile.deploy", 'Kogito Apps Deploy')
void setupReleaseDeployJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-apps-deploy', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.deploy", 'Kogito Apps 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([
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')

Expand All @@ -256,8 +232,8 @@ void setupDeployJob(JobType jobType, String envName = '') {
}
}

void setupPromoteJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-apps-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Kogito Apps Promote')
void setupReleasePromoteJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-apps-promote', JobType.RELEASE, "${jenkins_path}/Jenkinsfile.promote", 'Kogito Apps Promote')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
jobParams.env.putAll([
PROPERTIES_FILE_NAME: 'deployment.properties',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-jenkins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
uses: kiegroup/kie-ci/.ci/actions/dsl-tests@main
with:
main-config-file-repo: kiegroup/kogito-pipelines
main-config-file-path: dsl/config/main.yaml
main-config-file-path: .ci/jenkins/config/main.yaml
branch-config-file-repo: kiegroup/kogito-pipelines
Loading