79539770

Date: 2025-03-27 18:43:42
Score: 1.5
Natty:
Report link

Small Trick in the view.

' or ''' won't be replaced until the p4 view is being executed.

" or """ will be replaced before the p4 view is being executed.

The variables defined by the plug in must be replaced during the execution as they don't exist until that point so must be in the ` or '''. For instance ${JOB_NAME}, ${P4_CLIENT}, etc. See: https://help.perforce.com/helix-core/integrations-plugins/p4jenkins/current/Content/P4Jenkins/variable-expansion.html#Define_your_own_variables

The variables defined in the Jenkins environment (in example ${BRANCH}) need to be replaced before plugin executes so have to be in a " or """.

So when you want to use both you will need to piece the string together
Example:
'//depot/' + "${BRANCH}" + '/... //jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}/' + "${BRANCH}" + '/...'

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Nobody