Skip to content

Commit

Permalink
NO_ISSUE: add jenkins agent docker config into main.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
jstastny-cz committed May 23, 2024
1 parent 6a8d400 commit b9ba1ca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .ci/jenkins/config/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ seed:
jenkinsfile: dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
jenkins:
email_creds_id: KOGITO_CI_NOTIFICATION_EMAILS
agent:
docker:
builder:
# At some point, this image will need to be changed when a release branch is created
# but we need to make sure the image exists first ... simple tag before setting up the branch ?
# See https://github.com/kiegroup/kie-issues/issues/551
image: quay.io/kiegroup/kogito-ci-build:main-latest
args: --privileged --group-add docker
6 changes: 6 additions & 0 deletions dsl/seed/jenkinsfiles/Jenkinsfile.seed.main
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pipeline {
SEED_CONFIG_FILE_GIT_AUTHOR_PUSH_CREDS_ID: readSeedConfig().seed.config_file.git.author.push.credentials_id,
SEED_CONFIG_FILE_GIT_BRANCH: "${SEED_CONFIG_FILE_GIT_BRANCH}",
SEED_CONFIG_FILE_PATH: "${SEED_CONFIG_FILE_PATH}",
JENKINS_AGENT_DOCKER_BUILDER_IMAGE: readSeedConfig().jenkins.agent.docker.builder.image,
JENKINS_AGENT_DOCKER_BUILDER_ARGS: readSeedConfig().jenkins.agent.docker.builder.args,
ALL_BRANCHES: readSeedConfig().git.branches.collect { it.name }.join(','),
MAIN_BRANCH_NAME: readSeedConfig().git.branches.find { it.main_branch }?.name,
]
Expand Down Expand Up @@ -104,6 +106,8 @@ pipeline {
SEED_CONFIG_FILE_GIT_AUTHOR_PUSH_CREDS_ID: branchConfigFileInfo.push_credentials,
SEED_CONFIG_FILE_GIT_BRANCH: branchConfigFileInfo.branch,
SEED_CONFIG_FILE_PATH: branchConfigFileInfo.filepath,
JENKINS_AGENT_DOCKER_BUILDER_IMAGE: readSeedConfig().jenkins.agent.docker.builder.image,
JENKINS_AGENT_DOCKER_BUILDER_ARGS: readSeedConfig().jenkins.agent.docker.builder.args,
]
echo 'Got envProperties for generation'
echo "${envProperties}"
Expand Down Expand Up @@ -138,6 +142,8 @@ pipeline {
SEED_CONFIG_FILE_GIT_BRANCH: "${SEED_CONFIG_FILE_GIT_BRANCH}",
SEED_CONFIG_FILE_PATH: "${SEED_CONFIG_FILE_PATH}",
JENKINS_EMAIL_CREDS_ID: readSeedConfig().jenkins.email_creds_id,
JENKINS_AGENT_DOCKER_BUILDER_IMAGE: readSeedConfig().jenkins.agent.docker.builder.image,
JENKINS_AGENT_DOCKER_BUILDER_ARGS: readSeedConfig().jenkins.agent.docker.builder.args,
]
dir(scriptUtils.getDslSeedFolderAbsolutePath()) {
println "[INFO] Generate main seed job with properties ${envProperties}"
Expand Down
4 changes: 2 additions & 2 deletions dsl/seed/jobs/seed_job_branch.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ pipelineJob("${GENERATION_BRANCH}/tools/toggle-dsl-triggers") {

env('JENKINS_EMAIL_CREDS_ID', Utils.getJenkinsEmailCredsId(this))

env('AGENT_DOCKER_BUILDER_IMAGE', Utils.getJenkinsAgentDockerImage(script, 'builder'))
env('AGENT_DOCKER_BUILDER_ARGS', Utils.getJenkinsAgentDockerArgs(script, 'builder'))
env('AGENT_DOCKER_BUILDER_IMAGE', Utils.getJenkinsAgentDockerImage(this, 'builder'))
env('AGENT_DOCKER_BUILDER_ARGS', Utils.getJenkinsAgentDockerArgs(this, 'builder'))
}

definition {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class JobScriptsSpec extends Specification {
envVars.put('SEED_CONFIG_FILE_GIT_AUTHOR_PUSH_CREDS_ID', 'SEED_CONFIG_FILE_GIT_AUTHOR_PUSH_CREDS_ID')
envVars.put('SEED_CONFIG_FILE_GIT_BRANCH', 'SEED_CONFIG_FILE_GIT_BRANCH')
envVars.put('SEED_CONFIG_FILE_PATH', 'SEED_CONFIG_FILE_PATH')
envVars.put('JENKINS_AGENT_DOCKER_BUILDER_IMAGE', 'JENKINS_AGENT_DOCKER_BUILDER_IMAGE')
envVars.put('JENKINS_AGENT_DOCKER_BUILDER_ARGS', 'JENKINS_AGENT_DOCKER_BUILDER_ARGS')

envVars.put('GIT_JENKINS_CONFIG_PATH', 'GIT_JENKINS_CONFIG_PATH')
JobManagement jm = new JenkinsJobManagement(System.out, envVars, new File('.'))
Expand Down

0 comments on commit b9ba1ca

Please sign in to comment.