Skip to content

Commit

Permalink
kie-issues#872: adjust branch seed (#1193)
Browse files Browse the repository at this point in the history
Co-authored-by: jstastny-cz <jan.stastny@ibm.com>
  • Loading branch information
jstastny-cz and jstastny-cz committed May 7, 2024
1 parent fd5fa33 commit 116bfc3
Showing 1 changed file with 14 additions and 5 deletions.
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

0 comments on commit 116bfc3

Please sign in to comment.