Will this be usable outside of pipelines, or is it out of scope?
One of my projects is not using pipelines, but xml job configs. Basically, we've got a bunch of jobs with:
<builders>
<hudson.tasks.Shell>
<command>/bin/sh /some/script.sh ...</command>
</hudson.tasks.Shell>
</builders>
It would be nice to utilize an env var in that command to determine if the command is going to fail for the last time.
Nevermind. I should have been looking into naginator plugin, which is what we actually use to trigger retries.
So I can put this in the environment - of course, then it's "2", not 2 - i.e., a String, not an int. I'm trying to think if there's a way I can get around that and have it actually be an int but I don't think I'll be able to.
What should the count be starting at? First attempt is 0, second attempt (a.k.a. the first retry) is 1, etc? Or first attempt is 1, second attempt is 2, etc?