| So what I'm thinking right now, due to the complexity of what could be configured and the fact that the configuration has to be separate from the actual steps (since we just execute that closure at runtime, which wouldn't work at all if config directives were mixed up in the steps closure), is something like this:
stage('foo') {
config {
agent docker:'foo'
notifications {
always {
echo "something or other"
}
}
}
steps {
sh "./do-something.sh"
}
}
We'd still support the no-per-stage-config syntax (i.e., steps as the only things in the stage block) - that may be a pain to do in practice, so it's possible we'll end up adding the above as a new config section called, like, stageWithConfig or something along those lines. |