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

Pipeline Job-- deletedir() delete only current directory but @script and @tmp dir still there in workspace.

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.244

      Description

      Directories with an ampersand (like @tmp and @script, @libs) are not removed when using 'deletedir()' in pipeline stage.

      They are never cleaned up, even by the built in build discarders,
      On our instances we have 2172 folders with @libs (which is a copy of the shared library for the build)
      Which is taking up 7GB of space

        Attachments

          Issue Links

            Activity

            Hide
            cmamigonian Camden Mamigonian added a comment -

            So how exactly is this used?  Does using deleteDir() clean out the entire workspace and associated "@" directories?  Is there any impact on cleanWs()?

            Show
            cmamigonian Camden Mamigonian added a comment - So how exactly is this used?  Does using deleteDir() clean out the entire workspace and associated "@" directories?  Is there any impact on cleanWs()?
            Hide
            timja Tim Jacomb added a comment -

            Camden Mamigonian does my comment above not explain it well enough?

            Jenkins core workspace cleanup will remove them, deleteDir doesn't do it and neither does cleanWs
            Possibly they could be extended to do it now that the core API is there.

            Show
            timja Tim Jacomb added a comment - Camden Mamigonian does my comment above not explain it well enough? Jenkins core workspace cleanup will remove them, deleteDir doesn't do it and neither does cleanWs Possibly they could be extended to do it now that the core API is there.
            Hide
            cmamigonian Camden Mamigonian added a comment -

            Yes, sorry, your comment is clear in terms of core cleanup.  I wasn't sure if deleteDir or cleanWs support it.  Do we know if those plugin(s) have plans to incorporate?

            Show
            cmamigonian Camden Mamigonian added a comment - Yes, sorry, your comment is clear in terms of core cleanup.  I wasn't sure if deleteDir or cleanWs support it.  Do we know if those plugin(s) have plans to incorporate?
            Hide
            timja Tim Jacomb added a comment -

            Not that I know of, is there a reason that the automated cleanup isn't enough for you?

            Show
            timja Tim Jacomb added a comment - Not that I know of, is there a reason that the automated cleanup isn't enough for you?
            Hide
            cmamigonian Camden Mamigonian added a comment -

            If we have lots of jobs running on an agent our storage can fill up quickly, and we like to clean up after ourselves once the pipeline is done running.  We currently have a way to do it, but it's through our own code instead of a much simpler single call to either cleanWs or deleteDir.

            Show
            cmamigonian Camden Mamigonian added a comment - If we have lots of jobs running on an agent our storage can fill up quickly, and we like to clean up after ourselves once the pipeline is done running.  We currently have a way to do it, but it's through our own code instead of a much simpler single call to either cleanWs or deleteDir.

              People

              Assignee:
              timja Tim Jacomb
              Reporter:
              hiten_prajapati Hiten Prajapati
              Votes:
              67 Vote for this issue
              Watchers:
              87 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: