-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Describe your use-case which is not covered by existing documentation.
Look, it was really hard to do the first one.
Well, since it's not in the documentation, I'm sending it to have something.
Thanks for listening
def jobFullName = '_FULL_JOB_NAME'
// IMPORTANT: use a constant and unique identifier
def jobUUID = 'b7e3db59-4b28-4c03-b967-8b024818753e' // USING: https://www.uuidgenerator.net/
def jobGitRemoteUrl = 'git@github.com:_ORG_/_REPO_SOURCE_BUILD_.git'
def jobGitCredentialsId = '_JENKINS_CRED_ID_'
def jenkinsScriptPath = 'jenkins.yml'
def configDrivenRemoteUrl = 'git@github.com:_ORG_/_REPO_CONFIG_DRIVEN.git'
def configDrivenCredentialsId = '_JENKINS_CRED_ID_'
multibranchPipelineJob(jobFullName) {
branchSources {
git {
id(jobUUID)
remote(jobGitRemoteUrl)
credentialsId(jobGitCredentialsId)
}
}
factory {
configDrivenWorkflowBranchProjectFactory {
scriptPath(jenkinsScriptPath)
jenkinsFileScm {
gitSCM {
userRemoteConfigs {
userRemoteConfig {
url(configDrivenRemoteUrl)
credentialsId(configDrivenCredentialsId)
name('')
refspec('')
}
}
browser { }
gitTool('git')
branches { branchSpec { name('*/main') } }
doGenerateSubmoduleConfigurations(false)
}
}
}
}
orphanedItemStrategy { discardOldItems { numToKeep(10) } }
}Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.
No response
Reactions are currently unavailable