If you want to see all the parameters you can specify with it,
then go to the screen for configuring your job, and do:
Pipeline
-> Snippet Generator
-> Sample Step
-> git
-> Generate Groovy
The snippet generator will show you what parameters you can add to the git command. Using the snippet generator will help you a lot in terms
of figuring out how to use pipeline steps. It is not a comprehensive API reference, but it is better than nothing.
Now, in terms of running bat commands, I think you are on the right track.
If you want to take a look at how the bat command is implemented, look
It looks like the bat step runs the command you specify under "cmd /c",
and then echoes ERRORLEVEL after executing the command.
It is not clear to me if ERRORLEVEL is propagated back up through groovy in a way in which you can read it in your script. I am assuming no.
If you go back to the build-test.groovy which I wrote, you will see that
I catch exceptions, since the Bourne shell step doesn't have a return value which is useful. I think the WindowsBatchScript step also doesn't have a useful return value. I think what you can try doing, is see if the
bat step throws an exception if the underlying Windows command fails.
If that is the case, you can try catching exceptions, like how I did in build-test.groovy.
Good luck!
--
Craig