-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stage conditional on success of a run
result
#75
Comments
@chrissimon-au PRs are welcomed. whenRun is ok, but indeed it may duplicates alot of code. And not easy to extend. What about when' with stage overload, for example: pipeline "demo" {
when' (stage "xxx" {
run "xxxx"
})
....
}
|
Interesting idea, yes that would work, and provide more flexibility around managing the run. So in my case, it would be something like:
This would even look nicer if the stage is set to a variable earlier, e.g.
Since it's the Let me see if I can work out how to add it... will submit a PR or come back with more questions :) |
I have a situation where it would be helpful to have a way to conditionally run a stage depending on the success of a
run
command (in my case, agrep
).I could just run the cmd, and if it fails, then the stage will fail, and I've had a look at using
continueStageOnFailure
which doesn't run the rest of the stage and move to the next stage - which is exactly what I want, but has a few issues:when' false
)What it feels like I really need is something like
whenRun
which accepts the same arguments asrun
but which acts more like awhen'
command with the success result of therun
being thewhen'
argument.I'm happy to take a look at opening a PR for this, but wanted to know first if you'd be happy to include it, and if you have any suggestions for implementation.
From a browse through the source it looks like it should go into
ConditionsBuilder.fs
. But there are quite a lot of_.run
custom operations inStageBuilder
in order to create all the possible uses ofrun
- do I need to duplicate them all waswhenRun
variants, or is there an easier way you can see to achieve my goal?The text was updated successfully, but these errors were encountered: