From 38b25b863d148d3cf223c9a1f681c13e4bf39950 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Tue, 23 Jul 2024 16:06:29 -0300 Subject: [PATCH] Adjust release pipelines for the Apache 10 release --- .ci/jenkins/Jenkinsfile.deploy | 22 +++++++++++++--------- .ci/jenkins/dsl/jobs.groovy | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 912164d282..9fdd39b273 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -116,18 +116,13 @@ pipeline { .withOptions(env.KOGITO_APPS_BUILD_MVN_OPTS ? [ env.KOGITO_APPS_BUILD_MVN_OPTS ] : []) .skipTests(skipTests) - def Closure mavenRunClosure = { - configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { - mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE) - .run("clean $installOrDeploy") - } - } if (isRelease()) { release.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId()) mavenCommand.withProfiles(['apache-release']) - mavenRunClosure() - } else { - mavenRunClosure() + } + + configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { + mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean $installOrDeploy") } } } @@ -153,6 +148,11 @@ pipeline { } else { println '[WARN] no changes to commit' } + + // Create a new tag + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) + githubscm.tagRepository(getGitTagName()) + githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) } } } @@ -280,3 +280,7 @@ String getReleaseGpgSignKeyCredsId() { String getReleaseGpgSignPassphraseCredsId() { return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID } + +String getGitTagName() { + return params.GIT_TAG_NAME +} diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index b3a063293f..dbaab3b735 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -239,6 +239,7 @@ void setupReleaseDeployJob() { booleanParam('CREATE_PR', false, 'Should we create a PR with the changes ?') stringParam('PROJECT_VERSION', '', 'Optional if not RELEASE. If RELEASE, cannot be empty.') stringParam('KOGITO_PR_BRANCH', '', 'PR branch name') + stringParam('GIT_TAG_NAME', '', 'Git tag to create. i.e.: 10.0.0-rc1') booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.') } @@ -303,7 +304,6 @@ void setupWeeklyDeployJob() { booleanParam('SKIP_TESTS', false, 'Skip tests') - stringParam('GIT_CHECKOUT_DATETIME', '', 'Git checkout date and time - (Y-m-d H:i)') booleanParam('SEND_NOTIFICATION', false, 'In case you want the pipeline to send a notification on CI channel for this run.')