• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core, p4-plugin
    • Jenkins 2.19.1 LTS, P4 plugin 1.4.8, Perforce Plugin 1.3.36, Ubuntu 16.04, Google Chrome 53.0.2785.143 m

      We use P4CLEANWORKSPACE as parameter in Perforce Plugin but we would like to move our jobs from Perforce Plugin to P4 Plugin. Would it be possible to add this kind of variable to P4 Plugin to make clean workspace on demand?

          [JENKINS-39209] parametrized wipe of workspace (P4 Plugin)

          I think it is already there in the dsl...

          checkout([$class: 'PerforceScm', credential: 'p4_credentials', populate: [$class: 'AutoCleanImpl', delete: true, modtime: false, parallel: [enable: false, minbytes: '1024', minfiles: '1', path: '/usr/local/bin/p4', threads: '4'], pin: '', quiet: true, replace: true], workspace: [$class: 'StreamWorkspaceImpl', charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}', pinHost: false, streamName: '//somestream/xxx']])

          Francis Hitchens added a comment - I think it is already there in the dsl... checkout([$class: 'PerforceScm', credential: 'p4_credentials', populate: [$class: 'AutoCleanImpl', delete: true, modtime: false , parallel: [enable: false, minbytes: '1024', minfiles: '1', path: '/usr/local/bin/p4', threads: '4'] , pin: '', quiet: true, replace: true], workspace: [$class: 'StreamWorkspaceImpl', charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}', pinHost: false, streamName: '//somestream/xxx'] ])

          Paul Allen added a comment -

          Just to clarify:

          • do you want to remove all the files and use a forced sync.
          • or delete the workspace (and contents) after a build (disposable workspaces)?

          The first you can use the 'Force Clean and Sync' populate option ($class: 'ForceCleanImpl').

          The second you can use Perforce: Cleanup (p4cleanup true).

          Paul Allen added a comment - Just to clarify: do you want to remove all the files and use a forced sync. or delete the workspace (and contents) after a build (disposable workspaces)? The first you can use the 'Force Clean and Sync' populate option ($class: 'ForceCleanImpl'). The second you can use Perforce: Cleanup (p4cleanup true).

          Thank you guys. I will close this issue.

          Daniel Ordowski added a comment - Thank you guys. I will close this issue.

          Francis and Paul have solved this problem.

          Daniel Ordowski added a comment - Francis and Paul have solved this problem.

            Unassigned Unassigned
            nick1907 Daniel Ordowski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: