#!groovy

folder('lightning')

['core', 'standalone', 'maven', 'gradle', 'lambda'].each { module ->

    multibranchPipelineJob("lightning/${module}") {
        branchSources {
            git {
                remote('git@github.com:automatictester/lightning.git')
                credentialsId('github-creds')
            }
        }
        properties {
            folderLibraries {
                libraries {
                    libraryConfiguration {
                        name 'SharedLib'
                        retriever {
                            modernSCM {
                                scm {
                                    git {
                                        id 'lightning-git-repo'
                                        remote 'git@github.com:automatictester/lightning.git'
                                        credentialsId 'github-creds'
                                    }
                                }
                            }
                        }
                        allowVersionOverride true
                        defaultVersion 'master'
                        implicit true
                    }
                }
            }
        }
        configure {
            it / factory(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory') {
                owner(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject', reference: '../..')
                scriptPath("jenkins/${module}/Jenkinsfile")
            }
        }
    }
}

#!groovy

folder('lightning')

['core', 'standalone', 'maven', 'gradle', 'lambda'].each { module ->

    multibranchPipelineJob("lightning/${module}") {
        branchSources {
            git {
                remote('git@github.com:automatictester/lightning.git')
                credentialsId('github-creds')
            }
        }
        properties {
            folderLibraries {
                libraries {
                    libraryConfiguration {
                        name 'SharedLib'
                        retriever {
                            modernSCM {
                                scm {
                                    git {
                                        id 'lightning-git-repo'
                                        remote 'git@github.com:automatictester/lightning.git'
                                        credentialsId 'github-creds'
                                    }
                                }
                            }
                        }
                        allowVersionOverride true
                    }
                }
            }
        }
        configure {
            it / factory(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory') {
                owner(class: 'org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject', reference: '../..')
                scriptPath("jenkins/${module}/Jenkinsfile")
            }
        }
    }
}

Update JobDSL to account for non-master SharedLib execution
Update JobDSL to account for non-master SharedLib execution
