Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kiegroup repository references to apache #2968

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci/buildchain-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ default:
docker system prune -f

build:
- project: kiegroup/optaplanner
- project: apache/optaplanner
build-command:
before:
upstream: |
Expand All @@ -35,7 +35,7 @@ build:
upstream: |
mvn clean install -Dquickly ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_UPSTREAM }} ${{ env.OPTAPLANNER_BUILD_MVN_OPTS_UPSTREAM }}

- project: kiegroup/optaplanner-quickstarts
- project: apache/optaplanner-quickstarts
build-command:
current: |
mvn clean install ${{ env.BUILD_MVN_OPTS }} ${{ env.BUILD_MVN_OPTS_CURRENT }} ${{ env.OPTAPLANNER_QUICKSTARTS_BUILD_MVN_OPTS }}
Expand Down
6 changes: 3 additions & 3 deletions .ci/buildchain-project-dependencies.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: "2.1"
dependencies:
- project: kiegroup/optaplanner
- project: kiegroup/optaplanner-quickstarts
- project: apache/optaplanner
- project: apache/optaplanner-quickstarts
dependencies:
- project: kiegroup/optaplanner
- project: apache/optaplanner
mapping:
dependencies:
default:
Expand Down
2 changes: 1 addition & 1 deletion .ci/environments/common/update_quarkus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

mvn_cmd="mvn ${BUILD_MVN_OPTS:-} ${BUILD_MVN_OPTS_QUARKUS_UPDATE:-}"

source <(curl -s https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh)
source <(curl -s https://raw.githubusercontent.com/apache/kogito-pipelines/main/dsl/seed/scripts/install_quarkus.sh)

echo "Update project with Quarkus version ${QUARKUS_VERSION}"

Expand Down
44 changes: 44 additions & 0 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@Library('jenkins-pipeline-shared-libraries')_

pr_check_script = null

pipeline {
agent {
label 'ubuntu'
}
options {
timestamps()
timeout(time: '720', unit: 'MINUTES')
}
environment {
BUILDCHAIN_PROJECT = 'apache/optaplanner'
BUILDCHAIN_CONFIG_REPO = 'optaplanner'
BUILDCHAIN_CONFIG_FILE_PATH = '.ci/buildchain-config.yaml'

ENABLE_SONARCLOUD = 'true'
SONARCLOUD_ANALYSIS_MVN_OPTS = '-Dsonar.projectKey=org.optaplanner:optaplanner'
OPTAPLANNER_BUILD_MVN_OPTS = '-Prun-code-coverage'
}
stages {
stage('Initialize') {
steps {
script {
// load `pr_check.groovy` file from kogito-pipelines:main
dir('kogito-pipelines') {
checkout(githubscm.resolveRepository('kogito-pipelines', 'apache', 'main', false, 'ASF_Cloudbees_Jenkins_ci-builds'))
pr_check_script = load 'dsl/scripts/pr_check.groovy'
}
}
}
}
stage('PR check') {
steps {
script {
dir('kogito-pipelines') {
pr_check_script.launch()
}
}
}
}
}
}
31 changes: 9 additions & 22 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ imageUtils = null

pipeline {
agent {
label 'ubuntu'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand All @@ -28,21 +26,13 @@ pipeline {
disableConcurrentBuilds(abortPrevious: true)
}

// parameters {
// For parameters, check into .jenkins/dsl/jobs.groovy file
// }

environment {
// Some generated env is also defined into .jenkins/dsl/jobs.groovy file

OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

MAVEN_OPTS = '-Xms1024m -Xmx4g'

PR_BRANCH_HASH = "${util.generateHash(10)}"

// Maven configuration
MAVEN_DEPLOY_LOCAL_DIR = "${WORKSPACE}/maven_deploy_dir"
MAVEN_DEPLOY_LOCAL_DIR = "/tmp/maven_deploy_dir"
}

stages {
Expand Down Expand Up @@ -197,9 +187,6 @@ pipeline {
when {
expression { return shouldStageArtifacts() }
}
tools {
jdk 'kie-jdk11'
}
steps {
script {
// Stage release artifacts
Expand Down Expand Up @@ -320,7 +307,7 @@ void checkoutRepo(String repo, String dirName = repo) {
dir(dirName) {
deleteDir()
if (params.PR_TARGET_BRANCH) {
githubscm.checkoutIfExists(repo, getGitAuthor(), getBuildBranch(), 'kiegroup', getFallbackBranch(repo), true)
githubscm.checkoutIfExists(repo, getGitAuthor(), getBuildBranch(), 'apache', getFallbackBranch(repo), true)
} else {
checkout(githubscm.resolveRepository(repo, getGitAuthor(), getBuildBranch(), false))
}
Expand All @@ -331,15 +318,15 @@ void checkoutQuickstarts(String dirName = quickstartsRepository) {
dir(dirName) {
deleteDir()
if (params.PR_TARGET_BRANCH) {
githubscm.checkoutIfExists(quickstartsRepository, getGitAuthor(), getBuildBranch(), 'kiegroup', getQuickStartsBranch(), true)
githubscm.checkoutIfExists(quickstartsRepository, getGitAuthor(), getBuildBranch(), 'apache', getQuickStartsBranch(), true)
} else {
checkout(githubscm.resolveRepository(quickstartsRepository, getGitAuthor(), getQuickStartsBranch(), false))
}
}
}

String getFallbackBranch(String repo) {
def repositoryScm = githubscm.getRepositoryScm(repo, 'kiegroup', params.PR_TARGET_BRANCH)
def repositoryScm = githubscm.getRepositoryScm(repo, 'apache', params.PR_TARGET_BRANCH)
return repositoryScm ? params.PR_TARGET_BRANCH : 'main'
}

Expand Down Expand Up @@ -452,7 +439,7 @@ boolean shouldDeployToRepository() {
}

boolean isNotTestingBuild() {
return getGitAuthor() == 'kiegroup'
return getGitAuthor() == 'apache'
}

boolean isRelease() {
Expand Down
18 changes: 5 additions & 13 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ imageUtils = null

pipeline {
agent {
label 'ubuntu'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand All @@ -27,13 +25,7 @@ pipeline {
disableConcurrentBuilds(abortPrevious: true)
}

// parameters {
// For parameters, check into .jenkins/dsl/jobs.groovy file
// }

environment {
// Some generated env is also defined into .jenkins/dsl/jobs.groovy file

OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

PR_BRANCH_HASH = "${util.generateHash(10)}"
Expand Down Expand Up @@ -181,7 +173,7 @@ String getParamOrDeployProperty(String paramKey, String deployPropertyKey) {
//////////////////////////////////////////////////////////////////////////////

boolean isNotTestingBuild() {
return getGitAuthor() == 'kiegroup'
return getGitAuthor() == 'apache'
}

String getProjectVersion() {
Expand Down
19 changes: 4 additions & 15 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,20 @@ import org.kie.jenkins.MavenCommand

pipeline {
agent {
label 'ubuntu'
}

tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
timestamps()
timeout(time: 60, unit: 'MINUTES')
}

// parameters {
// For parameters, check into ./dsl/jobs.groovy file
// }

environment {
// Static env is defined into ./dsl/jobs.groovy file

OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Keep here for visitibility
MAVEN_OPTS = '-Xms1024m -Xmx4g'

BRANCH_HASH = "${util.generateHash(10)}"
}

Expand Down
13 changes: 4 additions & 9 deletions .ci/jenkins/Jenkinsfile.turtle
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ optaplannerRepo = 'optaplanner'

pipeline {
agent {
label 'ubuntu'
}
tools {
maven env.BUILD_MAVEN_TOOL
jdk env.BUILD_JDK_TOOL
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}
options {
timestamps()
timeout(time: 3, unit: 'DAYS') // Turtle tests take ~2 days to complete.
disableConcurrentBuilds(abortPrevious: true)
}
// parameters {
// For parameters, check the .jenkins/dsl/jobs.groovy file.
// }
environment {
MAVEN_OPTS = '-Xms1024m -Xmx4g'
// Contains the email address of the team's Zulip channel.
OPTAPLANNER_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")
}
Expand Down
8 changes: 5 additions & 3 deletions .ci/jenkins/config/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ repositories:
name: radtriste # TODO set back. Could not push to kiegroup
git:
author:
name: kiegroup
credentials_id: kie-ci5
token_credentials_id: kie-ci5-token
name: apache
# Taken from https://ci-builds.apache.org/credentials/
# Need to be verified
credentials_id: 399061d0-5ab5-4142-a186-a52081fef742
token_credentials_id: ci-builds
fork_author:
name: kie-ci
credentials_id: kie-ci
Expand Down
6 changes: 3 additions & 3 deletions .ci/jenkins/config/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ ecosystem:
- kie-benchmarks.*
git:
branches:
- name: apache_migration
- name: main
main_branch: true
seed:
config_file:
git:
repository: optaplanner
author:
name: kiegroup
name: apache
credentials_id: kie-ci5
branch: apache_migration
branch: main
path: .ci/jenkins/config/branch.yaml
jenkins:
email_creds_id: KOGITO_CI_NOTIFICATION_EMAILS
16 changes: 8 additions & 8 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* This file is describing all the Jenkins jobs in the DSL format (see https://plugins.jenkins.io/job-dsl/)
* needed by the Kogito pipelines.
*
* The main part of Jenkins job generation is defined into the https://github.com/kiegroup/kogito-pipelines repository.
* The main part of Jenkins job generation is defined into the https://github.com/apache/kogito-pipelines repository.
*
* This file is making use of shared libraries defined in
* https://github.com/kiegroup/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl.
* https://github.com/apache/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl.
*/

import org.kie.jenkins.jobdsl.model.JenkinsFolder
Expand Down Expand Up @@ -47,7 +47,7 @@ KogitoJobUtils.createMainQuarkusUpdateToolsJob(this,

void setupProjectDroolsJob(String droolsBranch) {
def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'optaplanner-drools-snapshot', JobType.NIGHTLY, 'ecosystem', "${jenkins_path_project}/Jenkinsfile.drools", 'Optaplanner testing against Drools snapshot')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.triggers = [ cron : 'H 2 * * *' ]
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
Expand Down Expand Up @@ -130,7 +130,7 @@ void setupProjectReleaseJob() {

void setupProjectPostReleaseJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-post-release', JobType.RELEASE, "${jenkins_path_project}/Jenkinsfile.post-release", 'Optaplanner Post Release')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

Expand Down Expand Up @@ -234,7 +234,7 @@ void setupSpecificBuildChainNightlyJob(String envName) {

void createSetupBranchJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'OptaPlanner Setup Branch')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
REPO_NAME: 'optaplanner',
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
Expand Down Expand Up @@ -262,7 +262,7 @@ void createSetupBranchJob() {

void setupDeployJob(JobType jobType, String envName = '') {
def jobParams = JobParamsUtils.getBasicJobParamsWithEnv(this, 'optaplanner-deploy', jobType, envName, "${jenkins_path}/Jenkinsfile.deploy", 'Optaplanner Deploy')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
if (jobType == JobType.PULL_REQUEST) {
jobParams.git.branch = '${BUILD_BRANCH_NAME}'
jobParams.git.author = '${GIT_AUTHOR}'
Expand Down Expand Up @@ -340,7 +340,7 @@ void setupDeployJob(JobType jobType, String envName = '') {

void setupPromoteJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'optaplanner-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Optaplanner Promote')
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

Expand Down Expand Up @@ -383,7 +383,7 @@ void setupPromoteJob(JobType jobType) {
void setupOptaPlannerTurtleTestsJob(String constraintStreamImplType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, "optaplanner-turtle-tests-${constraintStreamImplType}", JobType.OTHER, "${jenkins_path}/Jenkinsfile.turtle",
"Run OptaPlanner turtle tests with CS-${constraintStreamImplType} on a weekly basis.")
JobParamsUtils.setupJobParamsDefaultMavenConfiguration(this, jobParams)
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
CONSTRAINT_STREAM_IMPL_TYPE: "${constraintStreamImplType}",
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}"
Expand Down
4 changes: 2 additions & 2 deletions .ci/jenkins/dsl/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ fi
git_author="$(echo ${git_url} | awk -F"${git_server_url}" '{print $2}' | awk -F. '{print $1}' | awk -F/ '{print $1}')"

export DSL_DEFAULT_MAIN_CONFIG_FILE_REPO="${git_author}"/optaplanner
export DSL_DEFAULT_FALLBACK_MAIN_CONFIG_FILE_REPO=kiegroup/optaplanner
export DSL_DEFAULT_FALLBACK_MAIN_CONFIG_FILE_REPO=apache/optaplanner
export DSL_DEFAULT_MAIN_CONFIG_FILE_PATH=.ci/jenkins/config/main.yaml
export DSL_DEFAULT_BRANCH_CONFIG_FILE_REPO="${git_author}"/optaplanner

file=$(mktemp)
# For more usage of the script, use ./test.sh -h
curl -o ${file} https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/seed_test.sh
curl -o ${file} https://raw.githubusercontent.com/apache/kogito-pipelines/main/dsl/seed/scripts/seed_test.sh
chmod u+x ${file}
${file} $@
Loading