For me Jenkins is not working as expected. Even after using ws( SLAVE_ROOT/workspace/JOB_NAME@2') command it is throwing error:
Exception executing "curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py"java.io.IOException: Process working directory '/jenkins/SLAVE_ROOT/workspace/JOB_NAME@2' doesn't exist! And for some random runs it is working. On Wednesday, June 22, 2016 at 7:43:14 PM UTC+5:30, Antonio Muñiz wrote: > > > every workspace assigned is allowed to contain anything - from other > jobs > > No, only for the same job. > > > Is there a way to request a empty workspace > > No, you have to use deleteDir() to be sure. > > > that is also deleted after the node{} block completes > > No, again, use deleteDir() as the last step in `node` or `ws` (however, > having deleteDir() as first step you don't need this one). > > If you don't want to delete the entire workspace, you can use `dir` step > to create a directory inside the workspace (and clean it up by > `dir('dir_name') { deleteDir() }` > > BTW, all this information is in the snippet generator help tips (navigate > to http://[JENKINS]/job/[job_name]/pipeline-syntax/). > > On Wed, Jun 22, 2016 at 3:13 PM, James Read <[email protected] > <javascript:>> wrote: > >> Hi Antonio, >> >> So what I think you're saying, is that every workspace assigned is >> allowed to contain anything - from other jobs, and always deleteDir() >> should be used if a clean environment is needed? >> >> Is there a way to request a empty workspace, that is also deleted after >> the node{} block completes when using the Pipeline plugin? >> >> - James >> >> On Tuesday, 21 June 2016 16:30:22 UTC+1, Antonio Muñiz wrote: >>> >>> >>> On Tue, Jun 21, 2016 at 3:20 PM, James Read <[email protected]> wrote: >>> >>>> It seems that actually the Pipeline makes the whole Jenkinsfile 1x >>>> logical job, and the node{} blocks just allow different node selections >>>> during that job. >>> >>> >>> Not. Every `node` call has its workspace (and it can be erased at any >>> time by Jenkins core, so you never know if the workspace contains what you >>> think). Which means that the Jenkinsfile has to be idempotent and don't >>> rely on workspace contents from previous builds. Actually every node block >>> should remove/put whatever it needs (you can move things from one node to >>> another by using `stash`). >>> >>> If you request for two nodes in the same Jenkinsfile using different >>> labels, you would be using two nodes with two separated workspaces (even in >>> different physical machines!). >>> >>> >>> -- >>> Antonio Muñiz >>> Software Engineer >>> CloudBees, Inc. >>> >> -- >> 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/77432682-e150-469f-bef9-fc28297ddbb1%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/77432682-e150-469f-bef9-fc28297ddbb1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Antonio Muñiz > Software Engineer > CloudBees, Inc. > -- 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/51a06019-6e04-45c5-b82d-7ac306f84fee%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
