Home > other >  Set P4CLIENT from script called by Jenkins
Set P4CLIENT from script called by Jenkins

Time:12-15

I have a Jenkins pipeline configured with Perforce via the P4 Plugin. Everything works fine as far as syncing.

I farm out the pipeline stages to bash scripts. In one of these scripts, I need to interact with perforce, but I don't know how to get the client name that is currently in use. Jenkins/P4 Plugin does not set P4CLIENT, and I don't see any environment variables which contain the client name.

How can I set, find, or export the name of the perforce client so that p4 commands work?

CodePudding user response:

The problem I was having is that the option skipDefaultCheckout was set to true in the Jenkinsfile. When this is set, the normal p4 environment variables like P4_CLIENT are never set.

Solution: don't set skipDefaultCheckout to true

  • Related