The pin property is difficult to work with because it affects polling. Add an additional String property such as buildChange or change to the Populate class that can be set via a @DataBoundSetter. Update CheckoutTask#getBuildChange to also consider this value (if set) to determine the build change.
This will at least allow pipelines to easily sync to specific changelists / labels / counters that come from job parameters.
Example (assuming String parameter 'Changelist' exists):
checkout( perforce( credential: 'credential', populate: syncOnly( change: params.Changelist, force: false, have: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: false, revert: false ), workspace: streamSpec( charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}', pinHost: true, streamName: '//depot/path' ) ) )
- is related to
-
JENKINS-54472 Pin build at Perforce Label does not support variable expansion
- Closed