This is an automated email from the ASF dual-hosted git repository.

jstastnycz pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-pipelines.git


The following commit(s) were added to refs/heads/main by this push:
     new 116bfc35 kie-issues#872: adjust branch seed (#1193)
116bfc35 is described below

commit 116bfc35edf481bab250860039611da1f54dd7c0
Author: Jan Stastny <[email protected]>
AuthorDate: Tue May 7 15:02:44 2024 +0200

    kie-issues#872: adjust branch seed (#1193)
    
    Co-authored-by: jstastny-cz <[email protected]>
---
 dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch 
b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
index fed4e281..e12f2038 100644
--- a/dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
+++ b/dsl/seed/jenkinsfiles/Jenkinsfile.seed.branch
@@ -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()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to