This is an automated email from the ASF dual-hosted git repository.
jstastnycz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-optaplanner.git
The following commit(s) were added to refs/heads/main by this push:
new 1c6a453f46 [NO-ISSUE] Use apache-release profile when doing a release
build (#3093)
1c6a453f46 is described below
commit 1c6a453f4657e8b8765a25d6636f06a2d1132bbf
Author: Tibor Zimányi <[email protected]>
AuthorDate: Fri May 24 11:27:44 2024 +0200
[NO-ISSUE] Use apache-release profile when doing a release build (#3093)
* Add apache-release profile to release builds.
* Add password to gpg signing setup.
* Fix Maven settings use.
* Add GPG password to Maven command.
* Run from within withCredentials block when releasing.
---
.ci/jenkins/Jenkinsfile.deploy | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy
index 28ab4d6d62..acc3daf778 100644
--- a/.ci/jenkins/Jenkinsfile.deploy
+++ b/.ci/jenkins/Jenkinsfile.deploy
@@ -139,14 +139,35 @@ pipeline {
} else {
installOrDeploy = 'install'
}
- configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
- getOptaplannerMavenCommand()
- .withProperty('maven.test.failure.ignore',
true)
- .withProperty('operator.image.build')
- .skipTests(params.SKIP_TESTS)
- .withSettingsXmlFile(MAVEN_SETTINGS_FILE)
- .run("clean $installOrDeploy")
+
+ def mavenCommand = getOptaplannerMavenCommand()
+ .withProperty('maven.test.failure.ignore', true)
+ .withProperty('operator.image.build')
+ .skipTests(params.SKIP_TESTS)
+
+ if (isRelease()) {
+ withCredentials([file(credentialsId:
'asf-release-gpg-signing-key', variable: 'SIGNING_KEY')]) {
+ withCredentials([file(credentialsId:
'asf-release-gpg-signing-key-password', variable: 'SIGNING_KEY_PASSWORD')]) {
+ // copy the key to singkey.gpg file in
*plain text* so we can import it
+ sh ('cat $SIGNING_KEY >
$WORKSPACE/signkey.gpg')
+ // Please do not remove list keys command.
When gpg is run for the first time, it may initialize some internals.
+ sh ('gpg --list-keys')
+ sh ("gpg --batch --pinentry-mode=loopback
--passphrase \"${SIGNING_KEY_PASSWORD}\" --import signkey.gpg")
+ sh ('rm $WORKSPACE/signkey.gpg')
+
+
mavenCommand.withProperty('gpg.passphrase', SIGNING_KEY_PASSWORD)
+
mavenCommand.withProfiles(['apache-release'])
+ configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean
$installOrDeploy")
+ }
+ }
+ }
+ } else {
+ configFileProvider([configFile(fileId:
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
+
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean
$installOrDeploy")
+ }
}
+
}
if (isRelease()) {
updateAntoraYaml(optaplannerFolder)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]