I am trying to create a multibranchPipelineJob in jobDSL, however the Jenkinsfile is at an alternative location to the default. I have looked through the docs https://jenkinsci
As this question still proves popular, to do this in JCasC you can do this
jobs:
- script: >
folder('common');
multibranchPipelineJob('common/jcasc-deploy') {
factory {
workflowBranchProjectFactory {
scriptPath('Jenkinsfile')
}
}
branchSources {
branchSource {
source {
gitSCMSource {
remote('git@gitlab.com:PROJECT/REPO.git')
credentialsId('gitlab-key')
id('jcasc-deploy')
}
}
buildStrategies {
buildAllBranches {
strategies {
skipInitialBuildOnFirstBranchIndexing()
}
}
}
}
}
triggers {
periodicFolderTrigger {
interval('1440')
}
}
configure { node ->
node / sources / data / 'jenkins.branch.BranchSource' / source / traits {
'jenkins.plugins.git.traits.BranchDiscoveryTrait'()
}
}
}