DBZ-4624 Conditionalize/Parameterize backport commit check

This commit is contained in:
Chris Cranford 2022-01-26 14:37:03 -05:00 committed by Jiri Pechanec
parent 2283973c11
commit 4f42f1693a
2 changed files with 15 additions and 2 deletions

View File

@ -29,6 +29,9 @@ pipelineJob('release-debezium-upstream') {
stringParam('UI_BRANCH', 'main', 'A branch from which Debezium UI is built') stringParam('UI_BRANCH', 'main', 'A branch from which Debezium UI is built')
booleanParam('DRY_RUN', true, 'When checked the changes and artifacts are not pushed to repositories and registries') booleanParam('DRY_RUN', true, 'When checked the changes and artifacts are not pushed to repositories and registries')
stringParam('MAVEN_CENTRAL_SYNC_TIMEOUT', '12', 'Timeout in hours to wait for artifacts being published in the Maven Central') stringParam('MAVEN_CENTRAL_SYNC_TIMEOUT', '12', 'Timeout in hours to wait for artifacts being published in the Maven Central')
booleanParam('CHECK_BACKPORTS', false, 'When checked the back ports between the two provided versions will be compared')
stringParam('BACKPORT_FROM_TAG', 'vx.y.z.Final', 'Tag where back port checks begin - e.g. v1.8.0.Final')
stringParam('BACKPORT_TO_TAG', 'vx.y.z.Final', 'Tag where back port checks end - e.g. v1.8.1.Final')
} }
definition { definition {

View File

@ -26,6 +26,13 @@ else if (DRY_RUN instanceof String) {
} }
echo "Dry run: ${DRY_RUN}" echo "Dry run: ${DRY_RUN}"
if (CHECK_BACKPORTS == null) {
CHECK_BACKPORTS = false
}
else if (CHECK_BACKPORTS instanceof String) {
CHECK_BACKPORTS = Boolean.valueOf(CHECK_BACKPORTS)
}
GIT_CREDENTIALS_ID = 'debezium-github' GIT_CREDENTIALS_ID = 'debezium-github'
JIRA_CREDENTIALS_ID = 'debezium-jira-pat' JIRA_CREDENTIALS_ID = 'debezium-jira-pat'
HOME_DIR = '/home/centos' HOME_DIR = '/home/centos'
@ -339,9 +346,12 @@ node('Slave') {
} }
stage('Check missing backports') { stage('Check missing backports') {
if (!DRY_RUN) { if (!DRY_RUN && CHECK_BACKPORTS) {
if (!BACKPORT_FROM_TAG || !BACKPORT_TO_TAG) {
error "Backport from/to tags must be provided to perform backport checks"
}
dir(DEBEZIUM_DIR) { dir(DEBEZIUM_DIR) {
def rc = sh(script: "github-support/list-missing-commits-by-issue-key.sh", returnStatus: true) def rc = sh(script: "github-support/list-missing-commits-by-issue-key.sh $JIRA_VERSION $BACKPORT_FROM_TAG $BACKPORT_TO_TAG $JIRA_PAT", returnStatus: true)
if (rc != 0) { if (rc != 0) {
error "Error, there are some missing backport commits." error "Error, there are some missing backport commits."
} }