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

removing a job (including multibranch/org folder branches/repos) does not remove the workspace

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Removal of a job leaves the workspace intact.

        Attachments

          Issue Links

            Activity

            Hide
            michaelpporter Michael Porter added a comment -

            I would like the ability to call a cleanup script. We use Jenkins Mulitbranch Pipelines to build php websites. For me cleanup is removing a database and removing files from a custom workspace. At this time we call a php file on branch delete, which then processes a bash script that is saved on project build.

            Show
            michaelpporter Michael Porter added a comment - I would like the ability to call a cleanup script. We use Jenkins Mulitbranch Pipelines to build php websites. For me cleanup is removing a database and removing files from a custom workspace. At this time we call a php file on branch delete, which then processes a bash script that is saved on project build.
            Hide
            pjdarton pjdarton added a comment -

            Michael Porter I'd suggest that you take a look at the Post build task plugin and the PostBuildScript plugin.  Either of those might satisfy your requirements.  We have much the same requirements where I work and we use these (and we make our build setup code tolerant to a messy starting environment).

            That said, I'm don't think that the ability to call a cleanup script is really a core requirement of this issue - this issue is all to do with managing the workspace folders created by jobs, not in dealing with other job-specific resources used by jobs.

            Show
            pjdarton pjdarton added a comment - Michael Porter I'd suggest that you take a look at the Post build task plugin and the PostBuildScript plugin .  Either of those might satisfy your requirements.  We have much the same requirements where I work and we use these (and we make our build setup code tolerant to a messy starting environment). That said, I'm don't think that the ability to call a cleanup script is really a core requirement of this issue - this issue is all to do with managing the workspace folders created by jobs, not in dealing with other job-specific resources used by jobs.
            Hide
            michaelpporter Michael Porter added a comment -

            Thank you for the input. The plugins you mentioned will not help as I we do not want to call the cleanup post build, that is easy in pipeline. We want a cleanup hook in Jenkins that fires when it detects a branch is removed. As you mentioned there might be custom workspaces that are not Jenkins aware. I imagine the solution for cleaning those assets could also clean up other items.

            Show
            michaelpporter Michael Porter added a comment - Thank you for the input. The plugins you mentioned will not help as I we do not want to call the cleanup post build, that is easy in pipeline. We want a cleanup hook in Jenkins that fires when it detects a branch is removed. As you mentioned there might be custom workspaces that are not Jenkins aware. I imagine the solution for cleaning those assets could also clean up other items.
            Hide
            raijinsetsu Lucas Lacroix added a comment - - edited

            Michael Porter

            Have you considered building up and breaking down the database and other "external" dependencies as part of your build? We do this using Docker in our builds and the overhead of creating, initializing, and the subsequent teardown is negligible.

            I will say that, at least for a multibranch pipeline, having the ability to kick off a job on child job deletion/creation would be an interesting feature, but I agree anything like that is outside the scope of the issue here.

            Show
            raijinsetsu Lucas Lacroix added a comment - - edited Michael Porter Have you considered building up and breaking down the database and other "external" dependencies as part of your build? We do this using Docker in our builds and the overhead of creating, initializing, and the subsequent teardown is negligible. I will say that, at least for a multibranch pipeline, having the ability to kick off a job on child job deletion/creation would be an interesting feature, but I agree anything like that is outside the scope of the issue here.
            Hide
            captrespect Jon Roberts added a comment -

            As a workaround for this had to write a cron job that scans the get branches, matches them up with the workspace folders, then removes them.  An option that would just do then whenever the job is removed would be fantastic.

            Show
            captrespect Jon Roberts added a comment - As a workaround for this had to write a cron job that scans the get branches, matches them up with the workspace folders, then removes them.  An option that would just do then whenever the job is removed would be fantastic.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                bll6969 bll
              • Votes:
                90 Vote for this issue
                Watchers:
                100 Start watching this issue

                Dates

                • Created:
                  Updated: