| Hey I seem to be having this same issue or one very similar. Basically I'm looking to use a script that passes in a workspace branch depot path as a parameter to sync a view dynamically and run a build, and keeping the Jenkinsfile in source control. There seems to be 3 separate issues I've come across with this,. The first one is when trying to sync a Jenkinsfile in SCM I have the depot path as a build parameter string variable which could be one of many for example... //IES/dev/Features/Branch01 or //IES/dev/Features/Branch02 and so on... In the Jenkins SCM pipeline config, I have sync to a manual custom view, which is like this... ${feature_path}/... //jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/... However it seems that you cant use a variable string in a workspace mapping view if the variable starts with two forward slashes as per the above strings "//IES..." However the variable then does not expand to the string, it just stay as the variable name e.g. tries to sync as literally ${feature_path}/.. and throws an error that its not the right format. I also am not able to minus out starting with a " - " items from a view as per the same error in this ticket e.g. -//DevOps/prebuilt_Fortran/lib_debug/... //jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/prebuilt_Fortran/lib_debug/... This issue is not as important as I can just keep the items included, but it will just take longer to sync. I am able to get a bit further if I hard code the "//" in the Jenkinsfile sync step, and set the build parameter variable to not include the // for example... branch variable being passed in as: IES/dev/Features/Branch01 and in the sync step set up like below... p4sync charset: 'none', credential: 'perforce dev.build', populate: forceClean(have: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true), source: depotSource('''//${feature_path}/... //jenkins-${NODE_NAME}${JOB_NAME}${EXECUTOR_NUMBER}/...''') This then throws the following error... ERROR: P4: Unable to initialise CheckoutTask: hudson.AbortException: Error in client specification. Error detected at line 18. Null directory (//) not allowed in '//IES/dev/Features/Branch01/... //jenkins-Win10build02-VE-VE_Build_Requester-0/...'. Appreciate the help. Thanks for your time. Cheers Kieron. |