Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63357

p4 sync and p4publish behaves differently with forward slash.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin

      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.

            Unassigned Unassigned
            s3037560 Kevin Park
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: