Skip to content

Commit

Permalink
Remove prod jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Sep 7, 2023
1 parent f8d2b4c commit ed14b2a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 40 deletions.
12 changes: 2 additions & 10 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pipeline {
}
unsuccessful {
script {
pullrequest.postComment(util.getMarkdownTestSummary(isProdCI() ? 'Prod' : 'PR', '', "${BUILD_URL}", 'GITHUB'))
pullrequest.postComment(util.getMarkdownTestSummary('PR', "${BUILD_URL}", 'GITHUB'))
}
}
}
Expand Down Expand Up @@ -97,15 +97,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 util.runWithPythonVirtualEnv("make list | tr '\\n' ','", 'cekit', true).trim().split(',')
}

String getChangeAuthor() {
Expand Down
9 changes: 0 additions & 9 deletions .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,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 @@ -364,10 +359,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
28 changes: 7 additions & 21 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,17 @@ KogitoJobUtils.createEnvironmentIntegrationBranchNightlyJob(this, 'quarkus-lts')
setupDeployJob(JobType.RELEASE)
setupPromoteJob(JobType.RELEASE)

if (Utils.isProductizedBranch(this)) {
setupPrJob(true) // Prod CI job
setupProdUpdateVersionJob()
setupQuarkusUpdateJob(true) // Prod CI job
}

// Update quarkus on community
setupQuarkusUpdateJob()

/////////////////////////////////////////////////////////////////
// Methods
/////////////////////////////////////////////////////////////////

void setupPrJob(boolean isProdCI = false) {
setupBuildImageJob(JobType.PULL_REQUEST, isProdCI)
void setupPrJob() {
setupBuildImageJob(JobType.PULL_REQUEST)

def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-images', JobType.PULL_REQUEST, "${jenkins_path}/Jenkinsfile", "Kogito Images${isProdCI ? ' Prod' : ''} PR check")
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-images', JobType.PULL_REQUEST, "${jenkins_path}/Jenkinsfile", "Kogito Images PR check")
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
jobParams.pr.putAll([
run_only_for_branches: [ "${GIT_BRANCH}" ],
Expand All @@ -55,13 +49,7 @@ void setupPrJob(boolean isProdCI = false) {
commitContext: 'Retrieve and Launch Image Checks',
contextShowtestResults: false,
])
if (isProdCI) {
jobParams.job.name += '.prod'
jobParams.pr.trigger_phrase = '.*[j|J]enkins,?.*(rerun|run) [prod|Prod|PROD].*'
jobParams.pr.trigger_phrase_only = true
jobParams.pr.commitContext = '(Prod) Retrieve and Launch Image Checks'
jobParams.env.put('PROD_CI', true)
} else if (Utils.hasBindingValue(this, 'CLOUD_IMAGES')) {
if (Utils.hasBindingValue(this, 'CLOUD_IMAGES')) {
jobParams.env.put('IMAGES_LIST', Utils.getBindingValue(this, 'CLOUD_IMAGES'))
}
jobParams.env.putAll([
Expand Down Expand Up @@ -158,7 +146,7 @@ void setupDeployJob(JobType jobType) {
}
}

void setupBuildImageJob(JobType jobType, boolean prodCI = false) {
void setupBuildImageJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-images.build-image', jobType, "${jenkins_path}/Jenkinsfile.build-image", 'Kogito Images Build single image')
// Use jenkinsfile from the build branch
jobParams.git.author = '${SOURCE_AUTHOR}'
Expand All @@ -167,7 +155,6 @@ void setupBuildImageJob(JobType jobType, boolean prodCI = false) {
jobParams.env.putAll([
MAX_REGISTRY_RETRIES: 3,
TARGET_AUTHOR: Utils.getGitAuthor(this), // In case of a PR to merge with target branch
PROD_CI: prodCI,

AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
AUTHOR_TOKEN_CREDS_ID: "${GIT_AUTHOR_TOKEN_CREDENTIALS_ID}",
Expand Down Expand Up @@ -286,9 +273,8 @@ void setupProdUpdateVersionJob() {
}
}

void setupQuarkusUpdateJob(boolean isProdCI = false) {
def prodFlag = isProdCI ? '--prod' : ''
void setupQuarkusUpdateJob() {
KogitoJobUtils.createQuarkusUpdateToolsJob(this, 'kogito-images', [:], [:], [], [
"source ~/virtenvs/cekit/bin/activate && python3 scripts/update-repository.py --quarkus-platform-version %new_version% ${prodFlag}"
"source ~/virtenvs/cekit/bin/activate && python3 scripts/update-repository.py --quarkus-platform-version %new_version%"
])
}

0 comments on commit ed14b2a

Please sign in to comment.