基本上使用Jenkins Pipeline Syntax 的“p4sync”语法可以正常工作:
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/...'''
]
]
])