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

Add possibility to pass in commands for workspace cleanup

    • Icon: New Feature New Feature
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • ws-cleanup-plugin
    • None

      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
      }
      

          [JENKINS-55266] Add possibility to pass in commands for workspace cleanup

          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

          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

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

              Created:
              Updated:
              Resolved: