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] // script[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: P4: Task Exception: Invalid credentials
Finished: FAILURE
- causes
-
JENKINS-57314 P4 Sync to label after sync to head without deleting non labeled files
-
- Open
-
Ready for release.