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

Cleanup workspace only when previous build failed

      Normally, I leave the workspace there after a build, to improve the build time on the next build. But I encountered some issues (like changes in the Gt plugin, or submodule-related changes in my git repository) which are most easily resolved with a cleanup of the workspace

          [JENKINS-21321] Cleanup workspace only when previous build failed

          HI. So, are you saying that you are not using the WorkSpace cleanup plugin? But, you would like to use it if it had a "cleanup only if last build failed" mode?

          I think I have a related issue - I am using workspace cleanup plugin, I have it set to cleanup before each build, meaning the last build is always left there until the next builds. This means a lot of workspaces left around, which are normally never looked at, especially when it is a good build, but sometimes needed when it is a failed build. There is a setting in the WorkSpace cleanup plugin to cleanup as a Post-Build Step. Unfortunately (at least for me), this seems to always run, whether the build was good or failed. I was hoping that the Post Build cleanup would not get invoked in a failed build, thus workspaces of good builds would get deleted, but workspaces of failed builds would be left around and not deleted- this mode would allow one to inspect the workspace in the case of failed builds to help to debug the reason for thew build failure if needed.
          So, I would like to "Not cleanup workspace in Post-Build if a failed build."

          Rick Patterson added a comment - HI. So, are you saying that you are not using the WorkSpace cleanup plugin? But, you would like to use it if it had a "cleanup only if last build failed" mode? I think I have a related issue - I am using workspace cleanup plugin, I have it set to cleanup before each build, meaning the last build is always left there until the next builds. This means a lot of workspaces left around, which are normally never looked at, especially when it is a good build, but sometimes needed when it is a failed build. There is a setting in the WorkSpace cleanup plugin to cleanup as a Post-Build Step. Unfortunately (at least for me), this seems to always run, whether the build was good or failed. I was hoping that the Post Build cleanup would not get invoked in a failed build, thus workspaces of good builds would get deleted, but workspaces of failed builds would be left around and not deleted- this mode would allow one to inspect the workspace in the case of failed builds to help to debug the reason for thew build failure if needed. So, I would like to "Not cleanup workspace in Post-Build if a failed build."

            vjuranek vjuranek
            lurkie Lieuwe Hummel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: