forked from apache/incubator-kie-kogito-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "kie-issues#574 Initial ASF Jenkins CI Setup (apache#1703)"
This reverts commit 9ad98ac.
- Loading branch information
1 parent
5fac5e9
commit 2e22ecb
Showing
9 changed files
with
226 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
@Library('jenkins-pipeline-shared-libraries')_ | ||
|
||
pipeline { | ||
agent { | ||
label 'rhel8 && podman && !built-in' | ||
} | ||
|
||
options { | ||
timeout(time: 30, unit: 'MINUTES') | ||
} | ||
|
||
// parameters { | ||
// For parameters, check into ./dsl/jobs.groovy file | ||
// } | ||
|
||
environment { | ||
// Static env is defined into ./dsl/jobs.groovy file | ||
|
||
PR_BRANCH_HASH = "${util.generateHash(10)}" | ||
} | ||
|
||
stages { | ||
stage('Initialization') { | ||
steps { | ||
script { | ||
assert getProdProjectVersion() | ||
assert getJiraNumber() | ||
|
||
currentBuild.displayName = getProdProjectVersion() | ||
|
||
deleteDir() | ||
checkout(githubscm.resolveRepository(getRepoName(), getGitAuthor(), getBuildBranch(), false)) | ||
} | ||
} | ||
} | ||
stage('Prepare for PR') { | ||
steps { | ||
script { | ||
githubscm.createBranch(getPRBranch()) | ||
} | ||
} | ||
} | ||
stage('Update prod version') { | ||
when { | ||
expression { return getProdProjectVersion() != '' } | ||
} | ||
steps { | ||
script { | ||
sh "python3 scripts/manage-kogito-version.py --bump-to ${getProdProjectVersion()} --confirm --prod" | ||
} | ||
} | ||
} | ||
stage('Create PR') { | ||
steps { | ||
script { | ||
String commitMsg = "[${getJiraNumber()}] Update product version to ${getProdProjectVersion()}" | ||
if (githubscm.isThereAnyChanges()) { | ||
githubscm.commitChanges(commitMsg) | ||
} else { | ||
error 'No update version can be done' | ||
} | ||
githubscm.pushObject('origin', getPRBranch(), getGitAuthorCredsID()) | ||
String prLink = githubscm.createPR(commitMsg, 'Please review and merge', getBuildBranch(), getGitAuthorCredsID()) | ||
|
||
echo "Created PR ${prLink}" | ||
} | ||
} | ||
} | ||
} | ||
post { | ||
cleanup { | ||
cleanWs() | ||
} | ||
} | ||
} | ||
|
||
String getRepoName() { | ||
return "${REPO_NAME}" | ||
} | ||
|
||
String getBuildBranch() { | ||
return "${BUILD_BRANCH_NAME}" | ||
} | ||
|
||
String getGitAuthor() { | ||
return "${GIT_AUTHOR}" | ||
} | ||
|
||
String getGitAuthorCredsID() { | ||
return env.AUTHOR_CREDS_ID | ||
} | ||
|
||
String getPRBranch() { | ||
return "${getProdProjectVersion() ?: getBuildBranch()}-${env.PR_BRANCH_HASH}" | ||
} | ||
|
||
String getProdProjectVersion() { | ||
return "${PROD_PROJECT_VERSION}" | ||
} | ||
|
||
String getJiraNumber() { | ||
return "${JIRA_NUMBER}" | ||
} |
Oops, something went wrong.