[ 
https://issues.jenkins-ci.org/browse/JENKINS-13108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160616#comment-160616
 ] 

Rob Petti commented on JENKINS-13108:
-------------------------------------

You can file a feature request to add a generic 'exclude' option to workspace 
cleans, but it may be easier and faster to use a conditional pre-build step to 
do the clean manually using scripts:
https://wiki.jenkins-ci.org/display/JENKINS/pre-scm-buildstep
I haven't tested this myself, but it should work with a bit of effort.

Alternatively, you can just let jenkins clean it normally, and add a build step 
to recreate the .p4config file at build time. All the required config options 
are available in the environment, so it should be fairly easy to do.
eg.
{code}
echo P4PORT=$P4PORT > .p4config
echo P4USER=$P4USER >> .p4config
echo P4CLIENT=$P4CLIENT >> .p4config
echo P4PASSWD=$P4PASSWD >> .p4config
{code}
                
> Removing P4CONFIG file on cleaning workspace
> --------------------------------------------
>
>                 Key: JENKINS-13108
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-13108
>             Project: Jenkins
>          Issue Type: Bug
>          Components: perforce
>    Affects Versions: current
>            Reporter: Alexey Larsky
>            Assignee: Rob Petti
>
> Cleaning workspace causing to remove local workspace config file.
> http://www.perforce.com/perforce/doc.current/manuals/cmdref/env.P4CONFIG.html
> http://www.jetbrains.com/idea/webhelp/using-multiple-perforce-depots-with-p4config.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to