No files are reconciled or submitted when using forward slash in p4publish while files are synced okay even though there is a forward slash in p4sync.
There is a path (e.g. C:\jenkins\workspace\xxx/b) within the ws() command in the following pipeline script. The path contained a forward slash at the end. p4sync has always coped fine. However, no files are reconciled or submitted when using forward slash in p4publish.
stage('Publish') {
steps {
ws("${PUBLISH_WORKSPACE}") {
p4sync(
credential: ‘xxx’,
format: 'jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}_publish',
populate: autoClean(),
source: streamSource(‘//xxx/xxx/xxx’)
)
}
bat 'XCopy /E /I /Y \"%BUILD_WORKSPACE%\\xxx\\xxx\” \"%PUBLISH_WORKSPACE%\\xxx\”’
ws("${PUBLISH_WORKSPACE}") {
p4publish(
credential: ‘xxx’,
publish: submit(
description: 'Submitted by Jenkins. Build: ${BUILD_TAG}',
onlyOnSuccess: false
),
workspace: staticSpec(
name: 'jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}_publish'
)
)
}
}
}
Changing this to be a backslash seems to have fixed the issue that p4publish was having, and doesn't seem to have introduced any issues with p4sync.
The purpose of “ws("${PUBLISH_WORKSPACE}”)” was to run those stages in a Jenkins workspace that was contained within a sub folder.
This looks like a known Perforce internal bug - job105306.