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

Add possibility to pass in commands for workspace cleanup

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We run everything with `docker-compose` in our Jobs and we have to add a `docker-compose down` to the end of each stage, which takes unnecessary time from the jobs completion.

       

      It would be great if we could add a closure to `cleanWs` in order to run some commands deferredly at the end of the build

       

      cleanWs() {
        docker-compose -f docker-compose.ci.yml down --volumes --remove-orphans
      }
      

        Attachments

          Activity

          Hide
          olivergondza Oliver Gondža added a comment -

          Note that this is unrelated to cleaning workspace. you can hook custom cleanup using finally in scripted pipeline or post directive in declarative pipeline: https://stackoverflow.com/questions/36651432/how-to-implement-post-build-stage-using-jenkins-pipeline-plug-in

          Show
          olivergondza Oliver Gondža added a comment - Note that this is unrelated to cleaning workspace. you can hook custom cleanup using finally in scripted pipeline or post directive in declarative pipeline: https://stackoverflow.com/questions/36651432/how-to-implement-post-build-stage-using-jenkins-pipeline-plug-in

            People

            Assignee:
            olivergondza Oliver Gondža
            Reporter:
            deiga Timo Sand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: