Hi, generally you should always consider these workspaces as temporary and managed by jenkins. If you need to put files (persistent) in defined places you should do this by explicitly copying the files (or e.g. use one of the artifact publisher plugins).
And check the ws step docs: <quote> A workspace is automatically allocated for you with the node step, or you can get an alternate workspace with this ws step, but by default the location is chosen automatically. (Something like AGENT_ROOT/workspace/JOB_NAME@2.) You can instead specify a path here and that workspace will be locked instead. (The path may be relative to the build agent root, or absolute.) If concurrent builds ask for the same workspace, a directory with a suffix such as @2 may be locked instead. Currently there is no option to wait to lock the exact directory requested; if you need to enforce that behavior, you can either fail (error) when pwd indicates that you got a different directory, or you may enforce serial execution of this part of the build by some other means such as stage name: '…', concurrency: 1. If you do not care about locking, just use the dir step to change current directory. </quote> lalchan...@gmail.com schrieb am Samstag, 18. September 2021 um 19:18:28 UTC+2: > Yes now I have added this but still I am noticing workspace getting > created with @2 > > > > > On Sat, 18 Sep, 2021, 22:38 geoffroy...@gmail.com, <geoffroy...@gmail.com> > wrote: > >> Have you tried https://www.jenkins.io/doc/book/pipeline/syntax/#options >> >> options { disableConcurrentBuilds() } >> >> On Friday, 17 September 2021 at 18:35:02 UTC+2 lalchan...@gmail.com >> wrote: >> >>> I want default workspace should be working instead of @2. How can I >>> achieve that. >>> >>> Thanks, >>> Lalchand >>> >>> On Fri, 17 Sep, 2021, 19:14 'Dirk Heinrichs' via Jenkins Users, < >>> jenkins...@googlegroups.com> wrote: >>> >>>> Am Freitag, dem 17.09.2021 um 01:14 -0700 schrieb Lalchand Rajak: >>>> >>>> I have a job running in Jenkins and It's creating a workspace with a >>>> job name@2 or sometimes with @3. Can any one help why this is happening?. >>>> >>>> >>>> Because you have multiple builds of that job running at the same time. >>>> You don't want them to build in the same workspace, do you? >>>> >>>> Bye... >>>> >>>> Dirk >>>> >>>> -- >>>> >>>> *Dirk Heinrichs* >>>> Senior Systems Engineer, Delivery Pipeline >>>> OpenText ™ Discovery | Recommind >>>> *Phone*: +49 2226 15966 18 <+49%202226%201596618> >>>> *Email*: dhei...@opentext.com >>>> *Website*: www.recommind.de >>>> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach >>>> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu >>>> Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, >>>> Registernummer HRB 10646 >>>> This e-mail may contain confidential and/or privileged information. If >>>> you are not the intended recipient (or have received this e-mail in error) >>>> please notify the sender immediately and destroy this e-mail. Any >>>> unauthorized copying, disclosure or distribution of the material in this >>>> e-mail is strictly forbidden >>>> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte >>>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail >>>> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und >>>> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte >>>> Weitergabe dieser Mail sind nicht gestattet. >>>> >>>> -- >>>> 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 jenkinsci-use...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/jenkinsci-users/d1148e47a9d8cdde0f9366bbbb7657b5a509e99e.camel%40opentext.com >>>> >>>> <https://groups.google.com/d/msgid/jenkinsci-users/d1148e47a9d8cdde0f9366bbbb7657b5a509e99e.camel%40opentext.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> 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 jenkinsci-use...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/b841e13c-859b-4b9b-9838-01a5b8065870n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/b841e13c-859b-4b9b-9838-01a5b8065870n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f62db2dd-48cc-404e-8894-f18ba7cd7196n%40googlegroups.com.