DBZ-4957 Release pipeline toggle to ignore snapshot deps

This commit is contained in:
Chris Cranford 2022-04-05 12:50:25 -04:00 committed by Jiri Pechanec
parent 60a899b53a
commit 1e425b304b
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@ pipelineJob('release-debezium-upstream') {
stringParam('UI_REPOSITORY', 'github.com/debezium/debezium-ui.git', 'Repository 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('IGNORE_SNAPSHOTS', false, 'When checked, snapshot dependencies are allowed to be released; otherwise build fails')
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')

View File

@ -26,6 +26,14 @@ else if (DRY_RUN instanceof String) {
}
echo "Dry run: ${DRY_RUN}"
if (IGNORE_SNAPSHOTS == null) {
IGNORE_SNAPSHOTS = false
}
else if (IGNORE_SNAPSHOTS instanceof String) {
IGNORE_SNAPSHOTS = Boolean.valueOf(IGNORE_SNAPSHOTS)
}
echo "Ignore snapshots: ${IGNORE_SNAPSHOTS}"
if (CHECK_BACKPORTS == null) {
CHECK_BACKPORTS = false
}
@ -236,7 +244,7 @@ def setTargetReleaseForJiraIssues() {
def mvnRelease(repoDir, repoName, branchName, buildArgs = '') {
def repoId = null
dir(repoDir) {
sh "mvn release:clean release:prepare -DreleaseVersion=$RELEASE_VERSION -Dtag=$VERSION_TAG -DdevelopmentVersion=$DEVELOPMENT_VERSION -DpushChanges=${!DRY_RUN} -Darguments=\"-DskipTests -DskipITs -Passembly $buildArgs\" $buildArgs"
sh "mvn release:clean release:prepare -DreleaseVersion=$RELEASE_VERSION -Dtag=$VERSION_TAG -DdevelopmentVersion=$DEVELOPMENT_VERSION -DpushChanges=${!DRY_RUN} -DignoreSnapshots=${IGNORE_SNAPSHOTS} -Darguments=\"-DskipTests -DskipITs -Passembly $buildArgs\" $buildArgs"
if (!DRY_RUN) {
withCredentials([usernamePassword(credentialsId: GIT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git push \"https://\${GIT_USERNAME}:\${GIT_PASSWORD}@${repoName}\" HEAD:$branchName --follow-tags"