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

kie-issues#872: adjust branch seed #1193

Merged
merged 1 commit into from
May 7, 2024
Merged
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
19 changes: 14 additions & 5 deletions dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,21 @@ def getRepoConfig(String repository, String generationBranch = "${GENERATION_BRA

String buildchainRepo = cfg.buildchain_config?.git?.repository
if (buildchainRepo) {
def buildchainRepoConfig = buildchainRepo == repository ? cfg : getRepoConfig(buildchainRepo, generationBranch)
cfg.buildchain_config.git.branch = cfg.buildchain_config.git.branch ?: buildchainRepoConfig.git.branch
def buildchainRepoConfig // to hold existing config from repositories section
if (all_repos.contains(buildchainRepo)) {
if (buildchainRepo == repository) { // it's the repository currently processed
buildchainRepoConfig = cfg
} else { // it's a different repository from repositories section
buildchainRepoConfig = getRepoConfig(buildchainRepo, generationBranch)
}
}

cfg.buildchain_config.git.author = cfg.buildchain_config.git.author ?: [:]
cfg.buildchain_config.git.author.name = cfg.buildchain_config.author?.name ?: buildchainRepoConfig.git.author.name
cfg.buildchain_config.git.author.credentials_id = cfg.buildchain_config.author?.credentials_id ?: buildchainRepoConfig.git.author.credentials_id
// below check if either cfg.buildchain_config or resolved buildchainRepoConfig exists and has value, if not resort to default
cfg.buildchain_config.git.branch = cfg.buildchain_config?.git?.branch ?: (buildchainRepoConfig?.git?.branch ?: generationBranch)
cfg.buildchain_config.git.author = cfg.buildchain_config?.git?.author ?: [:]
cfg.buildchain_config.git.author.name = cfg.buildchain_config?.author?.name ?: (buildchainRepoConfig?.git?.author?.name ?: cfg.git.author.name)
cfg.buildchain_config.git.author.credentials_id = cfg.buildchain_config?.author?.credentials_id ?: (buildchainRepoConfig?.git?.author?.credentials_id ?: cfg.git.author.credentials_id)
cfg.buildchain_config.git.author.token_credentials_id = cfg.buildchain_config?.author?.token_credentials_id ?: (buildchainRepoConfig?.git?.author?.token_credentials_id ?: cfg.git.author.token_credentials_id)
}

if (scriptUtils.isDebug()) {
Expand Down
Loading