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

P4Groovy p4.run() does not locate credentials in folder

XMLWordPrintable

      When credentials to use are in a folder, using them in a script with p4.run() will not find the credential.

      Repro:

      create a folder.

      within the folder, create a credential and a pipleline job.

      The job's script references the credential in the folder.

      {{ script{}}
      {{ def ws = [$class: 'ManualWorkspaceImpl', name: "jenkins-${NODE_NAME}-${JOB_NAME}", }}
      {{ spec: [view: "//depot/main/utilities/AppUtilities/src/... //jenkins-${NODE_NAME}-${JOB_NAME}/..."]]}}
      {{ def p4 = p4(credential: 'build-u18-20182', workspace: ws)}}
      {{ def output = p4.run('sync')}}
      {{ }}}

       

      A p4sync step using the same credential succeeds.

      ------------------------

      console log:
      [Pipeline] Start of Pipeline[Pipeline] nodeRunning on Jenkins in /var/lib/jenkins/jobs/pipelines/jobs/simple sync/workspace[Pipeline] {[Pipeline] script[Pipeline]

      {[Pipeline] p4[Pipeline] }

      [Pipeline] // script[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: P4: Task Exception: Invalid credentials
      Finished: FAILURE

            joel_brown Joel Brown
            joel_brown Joel Brown
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: