Skip to content

Commit

Permalink
Merge branch 'main' into incubator-kie-issues-1131-22
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhitocode authored Dec 4, 2024
2 parents 76cd4f4 + 972d5c4 commit f93c30c
Show file tree
Hide file tree
Showing 795 changed files with 33,267 additions and 7,447 deletions.
50 changes: 35 additions & 15 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pipeline {
}
stage('Prepare for PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
Expand Down Expand Up @@ -120,7 +120,7 @@ pipeline {
'version.org.kie', getDroolsVersion()
)

// Need artifacts available locally
// Need artifacts available locally
getMavenCommand()
.withProperty('quickly')
.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
Expand Down Expand Up @@ -152,20 +152,16 @@ pipeline {
if (params.SKIP_TESTS) {
mvnCmd.skipTests() // Conflict somehow with Python testing. If `skipTests={anyvalue}` is set, then exec plugin is not executed ...
}
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()
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
mvnCmd
.withProfiles(['apache-release'])
.withProperty('only.reproducible')
}
configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
mvnCmd.withSettingsXmlFile(MAVEN_SETTINGS_FILE)
.run("clean $installOrDeploy")
}

}
}
}
Expand All @@ -180,7 +176,7 @@ pipeline {
}
stage('Create PR') {
when {
expression { return isRelease() || isCreatePr() }
expression { return isCreatePr() }
}
steps {
script {
Expand All @@ -204,6 +200,26 @@ 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') })
} else {
println '[WARN] no changes to commit'
}
githubscm.tagRepository(getGitTagName())
githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId())
}
}
}
}
}
post {
always {
Expand Down Expand Up @@ -324,3 +340,7 @@ String getReleaseGpgSignKeyCredsId() {
String getReleaseGpgSignPassphraseCredsId() {
return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID
}

String getGitTagName() {
return params.GIT_TAG_NAME
}
17 changes: 9 additions & 8 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void createSetupBranchJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name),

IS_MAIN_BRANCH: "${Utils.isMainBranch(this)}",
])
Expand Down Expand Up @@ -192,10 +192,10 @@ void setupReleaseDeployJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}",
MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}",
MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.RELEASE.name),
MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.RELEASE.name),

RELEASE_GPG_SIGN_KEY_CREDS_ID: Utils.getReleaseGpgSignKeyCredentialsId(this),
RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID: Utils.getReleaseGpgSignPassphraseCredentialsId(this)
Expand All @@ -214,6 +214,7 @@ void setupReleaseDeployJob() {
stringParam('PROJECT_VERSION', '', 'Set the project version')
stringParam('DROOLS_VERSION', '', 'Drools version to set')
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.')
}
Expand All @@ -233,7 +234,7 @@ void setupReleasePromoteJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.RELEASE.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
])
Expand Down Expand Up @@ -267,10 +268,10 @@ void setupWeeklyDeployJob() {
GIT_AUTHOR_CREDS_ID: "${GIT_AUTHOR_CREDENTIALS_ID}",
GIT_AUTHOR_PUSH_CREDS_ID: "${GIT_AUTHOR_PUSH_CREDENTIALS_ID}",

MAVEN_SETTINGS_CONFIG_FILE_ID: "${MAVEN_SETTINGS_FILE_ID}",
MAVEN_SETTINGS_CONFIG_FILE_ID: Utils.getMavenSettingsConfigFileId(this, JobType.NIGHTLY.name),
MAVEN_DEPENDENCIES_REPOSITORY: "${MAVEN_ARTIFACTS_REPOSITORY}",
MAVEN_DEPLOY_REPOSITORY: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_URL}",
MAVEN_REPO_CREDS_ID: "${MAVEN_ARTIFACTS_UPLOAD_REPOSITORY_CREDS_ID}",
MAVEN_DEPLOY_REPOSITORY: Utils.getMavenArtifactsUploadRepositoryUrl(this, JobType.NIGHTLY.name),
MAVEN_REPO_CREDS_ID: Utils.getMavenArtifactsUploadRepositoryCredentialsId(this, JobType.NIGHTLY.name),
])
KogitoJobTemplate.createPipelineJob(this, jobParams)?.with {
parameters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand All @@ -15,42 +15,26 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
###

# Gradle
.gradle/
build/
gradle.properties

# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws
#

# NetBeans
nb-configuration.xml
name: "CI :: License headers"

# Visual Studio Code
.vscode
.factorypath
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

# OSX
.DS_Store
jobs:
check:
runs-on: ubuntu-latest

# Vim
*.swp
*.swo
steps:
- name: Checkout code
uses: actions/checkout@v3

# patch
*.orig
*.rej
- name: Download Apache RAT
run: |
curl -LO https://repo1.maven.org/maven2/org/apache/rat/apache-rat/0.16.1/apache-rat-0.16.1.jar
# Local environment
.env
- name: Run Apache RAT
run: |
java -jar apache-rat-0.16.1.jar -d . -E .rat-excludes | grep "== File:" && echo "The files listed above are missing license headers." && exit 1 || echo "All files have license headers."
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ target/
.run/
.checkstyle

*.log
*.log

# Apache RAT check excludes file
!.rat-excludes
3 changes: 0 additions & 3 deletions .mvn/maven.config

This file was deleted.

117 changes: 0 additions & 117 deletions .mvn/wrapper/MavenWrapperDownloader.java

This file was deleted.

Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
Loading

0 comments on commit f93c30c

Please sign in to comment.