-
Task
-
Resolution: Fixed
-
Major
-
None
pathRestriction is not implemented in extension GitContext. So when we want to use this we have to use configure block. It is fine if you are not in sandbox mode.
pipelineJob("jobname") { //.. definition { cpsScm { scm { git { //.. extensions { relativeTargetDirectory("myRootPath") // works because implemented pathRestriction('includedPaths', 'excludedPaths') // not implemented in the dsl plugin } // code below doesn't allowed in sandbox mode configure { node -> node / 'extensions' / 'hudson.plugins.git.extensions.impl.PathRestriction' { excludedRegions 'excludedPaths' } } } } } } }
Can't we add pathRestriction to the extensions GitContext.
Here is how relativeTargetDirectory implemented.