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

Allow passing custom clean parameters(for example -e "node_modules")

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      Hi,

      We want to use cleanBeforeCheckout() options but we want to exclude node_modules from cleaning. [Git clean](https://git-scm.com/docs/git-clean) has -e option which we want to use in this case.

      So do you think it would be a good idea to pass extra arguments to cleanBeforeCheckout:
      cleanBeforeCheckout("-e node_modules")

          [JENKINS-40343] Allow passing custom clean parameters(for example -e "node_modules")

          Mor L added a comment - - edited

          Excluding files from cleanBeforeCheckout can be very useful. In my case I'm unstashing some pipeling scripts before the checkout and this steps wipes them out. I would like to be able to specify an exclude pattern which would invoke the -e flag of the git clean command

          Mor L added a comment - - edited Excluding files from cleanBeforeCheckout can be very useful. In my case I'm unstashing some pipeling scripts before the checkout and this steps wipes them out. I would like to be able to specify an exclude pattern which would invoke the -e flag of the git clean command

          Peter McEvoy added a comment -

          Would be nice if a boolean could be passed in to conditionally control if clean should happen or not.  For fast incremental builds I don't want to clean, but occasionally I need to remove rogue binaries hanging around the workspace

          Peter McEvoy added a comment - Would be nice if a boolean could be passed in to conditionally control if clean should happen or not.  For fast incremental builds I don't want to clean, but occasionally I need to remove rogue binaries hanging around the workspace

            Unassigned Unassigned
            ivanovit Ivan Ivanov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: