Your answer is so obvious I feel ashamed of myself ! ;) I used: bat "git clean -dfx" which is IMHO the best. I find the additional checkout step very redundant as Jenkins itself checkout the files in order to get the Jenkinsfile.
Great thanks Mark On Tuesday, June 20, 2017 at 4:44:08 PM UTC+2, Mark Waite wrote: > > > > On Tue, Jun 20, 2017 at 8:38 AM Francois Marot <[email protected] > <javascript:>> wrote: > >> I converted an old style job to Multibranch Pipeline with a Jenkinsfile >> (declarative syntax). >> Problem is that files from previous build are present in new builds and >> cause numerous problems once packaged. >> In the old-style job, I used to activate the "clean before checkout " >> param of the git plugin. >> >> Problem is that I have no scm step now as it is a Multibranch Pipeline >> job and Jenkins itself is smart enough to checkout from git (in order to >> access the Jenksinfile describing the job). >> So how can I force Jenkins to "clean before checkout" ? >> > > You can insert a checkout step into your pipeline definition that will > include the "CleanBeforeCheckout" extension. An example is > https://github.com/MarkEWaite/jenkins-bugs/blob/JENKINS-43931/Jenkinsfile > . > > You can perform a shell step "git clean -xffd" as your first pipeline step > if you prefer. > > Mark Waite > > >> I have seen answers where the previous build deletes the workspace after >> completion but I find it not satisfying to rely on the behavior of previous >> jobs to complete one job. >> >> Regards, >> François >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/dfec64d8-92fc-49a4-9a09-82c575707d26%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/dfec64d8-92fc-49a4-9a09-82c575707d26%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d448ed91-39da-4c10-97fb-6850ee05d470%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
