I am doing static helpers for decreasing the complexity of my DSL-seed jobs.
But have just came to the point where I can't overcome the issue.
Here is static method:
//MultiSCMGit static method:
static MultiSCMGit(Job job, String URLValue, String credentialsValue, String branchValue, String relativeTargetDirectoryValue) {
job.with {
multiscm {
git {
remote {
url(URLValue)
credentials(credentialsValue)
}
branch(branchValue)
extensions {
relativeTargetDirectory(relativeTargetDirectoryValue)
}
}
}
}
}
And here how I call it. I need from time to time 2 or 3 GIT blocks in MULTISCM:
def newJob = job("$JobName")
//section for source control management system:
MultiSCMGit(newJob, 'g...@bitbucket.org:something.git', GitBitBucketKeyIdNumber, '*/master', 'scripts')
MultiSCMGit(newJob, 'g...@bitbucket.org:something_more.git', GitDeploymentKeyIdNumber, '${Commit}', 'sources')
As the result, I get only last block. As far as I understand it just uses full MULTISCM block which one was used last.
I can't figure out how to make it just add two GIT blocks into MULTISCM.
Any help or an advice is much appreciated.
Regards,
Taras.