Jenkins pipeline syntax for "p4sync"

I am trying to synchronize with Perforce in my pipeline script, but from the documentation I see no way to set "workspace behavior", although the plugin itself has this feature .

I want the "workspace" to be equivalent to the "Manual (custom view)" setting. I can configure in the user interface, as described here , What parameters do I need to pass to the p4sync task to achieve this?

+6
source share
1 answer

You will need to use the full DSL checkout , the p4sync DSL p4sync only basic. The easiest way is to use the Link Syntax link generator, select checkout: General SCM , then Perforce Software from the SCM list.

Then you can determine the detailed view. For instance:

 checkout([ $class: 'PerforceScm', credential: 'phooey1666', populate: [ $class: 'AutoCleanImpl', delete: true, modtime: false, pin: '', quiet: true, replace: true ], workspace: [ $class: 'ManualWorkspaceImpl', charset: 'none', name: 'jenkins-${NODE_NAME}-${JOB_NAME}', pinHost: false, spec: [ allwrite: true, clobber: false, compress: false, line: 'LOCAL', locked: false, modtime: false, rmdir: false, streamName: '', view: ''' //depot/... //jenkins-${NODE_NAME}-${JOB_NAME}/... -//depot/tests/... //jenkins-${NODE_NAME}-${JOB_NAME}/tests/...''' ] ] ]) 
+8
source

All Articles