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

Clean and force sync workspace on demand when using SyncOnly

      Hello,

      in our company we use FreeStyleBuilds (no pipelines) to run incremental builds of our projects.
      This is achieved by setting p4 plugin to "SyncOnly" and "Populate have list".
      Once per day (or on demand) we would like to run clean build, controlled by boolean build parameter P4_CLEANWORKSPACE. When this checkbox is on, workspace should be deleted and recreated prior to running build.
      I have tried to use "delete workspace" plugin, but then p4 plugin's have list was not updated and full (force) sync was not performed.
      I have implemented support for this feature and created pull request. Before sync phase, when there is P4_CLEANWORKSPACE environment variable set, build workspace is deleted and force sync is performed.
      Example implementation is on my branch:
      https://github.com/nephre/p4-plugin/tree/force_sync_when_p4cleanworkspace

      Is it possible to merge such change into master branch?
      If so, this is PR: https://github.com/jenkinsci/p4-plugin/pull/133

      Kind regards,
      Daniel Jeznach

          [JENKINS-66603] Clean and force sync workspace on demand when using SyncOnly

          Karl Wirth added a comment -

          Hi daniel_jeznach_img - Did you try the post build action 'Delete Client' or is that not useful because of the incremental nature of the builds?

          Karl Wirth added a comment - Hi daniel_jeznach_img - Did you try the post build action 'Delete Client' or is that not useful because of the incremental nature of the builds?

          p4karl it is not useful in this case because of incremental nature of these builds. Workspace should be cleaned explicitely only sometimes (when user requires it by parametrizing build) or once per day (full overnight builds).

          Daniel Jeznach added a comment - p4karl it is not useful in this case because of incremental nature of these builds. Workspace should be cleaned explicitely only sometimes (when user requires it by parametrizing build) or once per day (full overnight builds).

          Karl Wirth added a comment -

          Karl Wirth added a comment - Hi daniel_jeznach_img - Thanks.   FYI p4paul - Pull request https://github.com/jenkinsci/p4-plugin/pull/133

          I believe this is now merged, and the issue can be set to different status: https://github.com/jenkinsci/p4-plugin/pull/133.
          Thanks for adding this feature.

          Daniel Jeznach added a comment - I believe this is now merged, and the issue can be set to different status: https://github.com/jenkinsci/p4-plugin/pull/133 . Thanks for adding this feature.

            Unassigned Unassigned
            daniel_jeznach_img Daniel Jeznach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: