Skip to content

Commit

Permalink
Merge branch 'apache:main' into incubator-kie-issues#1478
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-beniamin authored Oct 7, 2024
2 parents 41cb9a1 + 4ca282e commit b497d72
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 48 deletions.
62 changes: 38 additions & 24 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ deployProperties = [:]

pipeline {
agent {
docker {
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
label util.avoidFaultyNodes()
Expand Down Expand Up @@ -82,12 +82,12 @@ pipeline {
}
stage('Prepare for PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
dir(getRepoName()) {
if (githubscm.isBranchExist('origin',getPRBranch())) {
if (githubscm.isBranchExist('origin', getPRBranch())) {
githubscm.removeRemoteBranch('origin', getPRBranch(), getGitAuthorPushCredsId())
}
githubscm.createBranch(getPRBranch())
Expand All @@ -101,7 +101,7 @@ pipeline {
}
steps {
script {
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
maven.mvnVersionsSet(
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
getProjectVersion(),
Expand All @@ -127,20 +127,15 @@ pipeline {
.withProperty('maven.test.failure.ignore', true)
.skipTests(params.SKIP_TESTS)

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())
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mavenCommand
.withProfiles(['apache-release'])
.withProperty('only.reproducible')
mavenRunClosure()
} else {
mavenRunClosure()
}

configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean $installOrDeploy")
}
}
}
Expand All @@ -156,7 +151,7 @@ pipeline {
}
stage('Create PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
Expand All @@ -180,6 +175,29 @@ pipeline {
}
}
}
stage('Commit and Create Tag') {
when {
expression { return isRelease() }
}
steps {
script {
dir(getRepoName()) {
if (githubscm.isThereAnyChanges()) {
def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}"
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.commitChanges(commitMsg, {
githubscm.findAndStageNotIgnoredFiles('pom.xml')
githubscm.findAndStageNotIgnoredFiles('antora.yml')
})
} else {
println '[WARN] no changes to commit'
}
githubscm.tagRepository(getGitTagName())
githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId())
}
}
}
}
}
post {
always {
Expand Down Expand Up @@ -283,22 +301,18 @@ MavenCommand getMavenCommand(String directory = '') {
def mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
.withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
.inDirectory(directory)
if (!isMainStream()) { // Workaround as enforcer rules may not be fixed on other streams
mvnCmd.withProperty('enforcer.skip')
} else {
mvnCmd.withProperty('full')
}
.withProperty('full')
return mvnCmd
}

boolean isMainStream() {
return env.DROOLS_STREAM == 'main'
}

String getReleaseGpgSignKeyCredsId() {
return env.RELEASE_GPG_SIGN_KEY_CREDS_ID
}

String getReleaseGpgSignPassphraseCredsId() {
return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID
}

String getGitTagName() {
return params.GIT_TAG_NAME
}
2 changes: 1 addition & 1 deletion .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ cloud:
release:
gpg:
sign:
key-credentials-id: 'GPG_KEY'
key-credentials-id: 'GPG_KEY_FILE'
passphrase-credentials-id: ''
jenkins:
email_creds_id: DROOLS_CI_NOTIFICATION_EMAILS
Expand Down
30 changes: 9 additions & 21 deletions drools-drlonyaml-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
<name>Drools :: DRL on YAML</name>
<packaging>pom</packaging>


<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
</modules>

<profiles>
<profile>
<id>allSubmodules</id>
Expand All @@ -40,30 +49,9 @@
</property>
</activation>
<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
<module>drools-drlonyaml-integration-tests</module>
</modules>
</profile>

<profile>
<id>onlyReproducible</id>
<activation>
<property>
<name>only.reproducible</name>
</property>
</activation>
<modules>
<module>drools-drlonyaml-schemagen</module>
<module>drools-drlonyaml-model</module>
<module>drools-drlonyaml-todrl</module>
<module>drools-drlonyaml-cli</module>
<module>drools-drlonyaml-cli-tests</module>
</modules>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ public final class Msg {
public static final Message2 ERR_COMPILING_ALLOWED_VALUES_LIST_ON_ITEM_DEF = new Message2( DMNMessageType.ERR_COMPILING_FEEL, "Error compiling allowed values list '%s' on item definition '%s'" );
public static final Message2 ERR_COMPILING_TYPE_CONSTRAINT_LIST_ON_ITEM_DEF = new Message2( DMNMessageType.ERR_COMPILING_FEEL, "Error compiling type constraint list '%s' on item definition '%s'" );
public static final Message4 ERR_COMPILING_FEEL_EXPR_FOR_NAME_ON_NODE = new Message4( DMNMessageType.ERR_COMPILING_FEEL, "Error compiling FEEL expression '%s' for name '%s' on node '%s': %s" );
public static final Message2 ERR_EVAL_CTX_ENTRY_ON_CTX = new Message2( DMNMessageType.ERR_EVAL_CTX, "Error evaluating context extry '%s' on context '%s'" );
public static final Message3 ERR_EVAL_CTX_ENTRY_ON_CTX_MSG = new Message3( DMNMessageType.ERR_EVAL_CTX, "Unrecoverable error evaluating context extry '%s' on context '%s': %s" );
public static final Message2 ERR_EVAL_CTX_ENTRY_ON_CTX = new Message2( DMNMessageType.ERR_EVAL_CTX, "Error evaluating context entry '%s' on context '%s'" );
public static final Message3 ERR_EVAL_CTX_ENTRY_ON_CTX_MSG = new Message3( DMNMessageType.ERR_EVAL_CTX, "Unrecoverable error evaluating context entry '%s' on context '%s': %s" );
public static final Message1 DECISION_NOT_FOUND_FOR_NAME = new Message1( DMNMessageType.DECISION_NOT_FOUND, "Decision not found for name '%s'" );
public static final Message1 DECISION_NOT_FOUND_FOR_ID = new Message1( DMNMessageType.DECISION_NOT_FOUND, "Decision not found for type '%s'" );
public static final Message1 DECISION_SERVICE_NOT_FOUND_FOR_NAME = new Message1( DMNMessageType.DECISION_NOT_FOUND, "Decision Service not found for name '%s'");
Expand Down

0 comments on commit b497d72

Please sign in to comment.