Hi,

If you are going to use the workflow plugin, I highly recommend you
watch this Youtube video by Cyrille Le Clerc from Cloudbees:

https://www.youtube.com/watch?v=Welwf1wTU-w

That video is so good, I think it should be, put in the README.md file for
the Workflow plugin.

I'm not sure, but I think most of your code is unnecessary, unless you have
it there for debugging.

I think this should work, but you might want to change the name of the dir
variable just to not clash with the dir() function:

node ('admins') {
     def mydir = '7packers-boxes'
      dir("${mydir}") {
          sh "pwd"
      }
}

The dir() function should create the directory, and in the block, it
internally
does a chdir() to that directory and then executes the code in that block.

Regarding cleaning things up, I filed this bug:
https://issues.jenkins-ci.org/browse/JENKINS-28382 "workflow plugin: no
option to Wipe Out Current Workspace".
That bug got marked as a duplicate.  There are definitely issues with
respect to cleaning up
workspaces used by the workflow plugin.

--
Craig


On Wed, May 27, 2015 at 8:23 AM, Markus "Shorty" Uckelmann <[email protected]>
wrote:

> Hi all,
>
> I just started to play a bit with the workflow-plugin and got stuck with
> dir step. My "awesome" code:
>
> stage 'box'
> node ('admins') {
>   def dir = '7packer-boxes'
>   sh "mkdir ${dir} || :"
>   echo "Changing to dir ${dir}"
>   sh "pwd"
>   dir("${dir}") {
>     sh "pwd"
>   }
> }
>
>
> The build starts, works to the point where the dir step is and then
> doesn't do anything. Also it just keeps running and I can't remove the
> build[1].
>
> Jenkins:  1.596.3
> Workflow: 1.6
>
> Any help would be much appreciated.
>
>
> [1] With /doDelete I can remove it from the slave but it still exists on
> the master. A restart of Jenkins might help.
>
>
> Cheers, Shorty
>
> --
> 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/5565E15F.6070808%40koeln.de
> .
> 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/CAG%3DrPVecuVS8%3DFSOvjGmCLvY2KvoL1J45bsojqLANAosX2OUUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to