Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13108

Removing P4CONFIG file on cleaning workspace

    XMLWordPrintable

    Details

    • Similar Issues:

      Attachments

        Activity

        Hide
        rpetti Rob Petti added a comment -

        I'll add it to the list of excluded paths, but it should be noted that the perforce plugin doesn't even use this file, so it's generally not needed anyways (though I can see how it would be convenient).

        Show
        rpetti Rob Petti added a comment - I'll add it to the list of excluded paths, but it should be noted that the perforce plugin doesn't even use this file, so it's generally not needed anyways (though I can see how it would be convenient).
        Hide
        scm_issue_link SCM/JIRA link daemon added a comment -

        Code changed in jenkins
        User: Rob Petti
        Path:
        src/main/java/hudson/plugins/perforce/PerforceSCM.java
        http://jenkins-ci.org/commit/perforce-plugin/7c0c24c8a2f4c65a2ac8046533c2adf093a1cb27
        Log:
        [FIXED JENKINS-13108] exclude p4config file from wipe on checkout

        note: Jenkins' built-in wipe out workspace functionality is not affected, and will still wipe the entire workspace (outside the scope of the p4 plugin)

        Show
        scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/perforce-plugin/7c0c24c8a2f4c65a2ac8046533c2adf093a1cb27 Log: [FIXED JENKINS-13108] exclude p4config file from wipe on checkout note: Jenkins' built-in wipe out workspace functionality is not affected, and will still wipe the entire workspace (outside the scope of the p4 plugin)
        Hide
        dogfood dogfood added a comment -

        Integrated in plugins_perforce #201
        [FIXED JENKINS-13108] exclude p4config file from wipe on checkout (Revision 7c0c24c8a2f4c65a2ac8046533c2adf093a1cb27)

        Result = SUCCESS
        Rob Petti :
        Files :

        • src/main/java/hudson/plugins/perforce/PerforceSCM.java
        Show
        dogfood dogfood added a comment - Integrated in plugins_perforce #201 [FIXED JENKINS-13108] exclude p4config file from wipe on checkout (Revision 7c0c24c8a2f4c65a2ac8046533c2adf093a1cb27) Result = SUCCESS Rob Petti : Files : src/main/java/hudson/plugins/perforce/PerforceSCM.java
        Hide
        alexey_larsky Alexey Larsky added a comment - - edited

        Thanks a lot. It work.
        How add this exclude to Jenkins' built-in wipe?
        Episodically we need clean builds for release build.

        Show
        alexey_larsky Alexey Larsky added a comment - - edited Thanks a lot. It work. How add this exclude to Jenkins' built-in wipe? Episodically we need clean builds for release build.
        Hide
        alexey_larsky Alexey Larsky added a comment -

        Thanks a lot. It work.
        How add this exclude to Jenkins' built-in wipe?
        Episodically we need clean builds for release build.

        Show
        alexey_larsky Alexey Larsky added a comment - Thanks a lot. It work. How add this exclude to Jenkins' built-in wipe? Episodically we need clean builds for release build.
        Hide
        rpetti Rob Petti added a comment -

        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.

        echo P4PORT=$P4PORT > .p4config
        echo P4USER=$P4USER >> .p4config
        echo P4CLIENT=$P4CLIENT >> .p4config
        echo P4PASSWD=$P4PASSWD >> .p4config
        
        Show
        rpetti Rob Petti added a comment - 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. echo P4PORT=$P4PORT > .p4config echo P4USER=$P4USER >> .p4config echo P4CLIENT=$P4CLIENT >> .p4config echo P4PASSWD=$P4PASSWD >> .p4config
        Hide
        alexey_larsky Alexey Larsky added a comment - - edited

        We use self made tool for manage Perforce projects. It store in .p4config extra information - project's bind with project's internal name:
        FOO=InternalProjectName

        This info not repeated in environment.

        Also our team like to clean workspace by Jenkins build-in wipe. I need to remove Jenkins build-in wipe or make it work.
        I think what best way - add feature request.

        It is possible simulate clean command in Perforce like "svn clean" ?
        It can be better then wipe...

        Show
        alexey_larsky Alexey Larsky added a comment - - edited We use self made tool for manage Perforce projects. It store in .p4config extra information - project's bind with project's internal name: FOO=InternalProjectName This info not repeated in environment. Also our team like to clean workspace by Jenkins build-in wipe. I need to remove Jenkins build-in wipe or make it work. I think what best way - add feature request. It is possible simulate clean command in Perforce like "svn clean" ? It can be better then wipe...
        Hide
        rpetti Rob Petti added a comment -

        You will likely need to write your own script in order to simulate 'svn clean'. There are plenty of resources for this online, such as the following *nix snippet:

        find . -type f | p4 -x- files 2>&1 | sed -n -e 's/ - no such file(s).//p' | xargs -d '\n' rm
        
        Show
        rpetti Rob Petti added a comment - You will likely need to write your own script in order to simulate 'svn clean'. There are plenty of resources for this online, such as the following *nix snippet: find . -type f | p4 -x- files 2>&1 | sed -n -e 's/ - no such file(s). //p' | xargs -d '\n' rm

          People

          • Assignee:
            rpetti Rob Petti
            Reporter:
            alexey_larsky Alexey Larsky
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: