Run commands (more than one that is) associated to a when attribute?


According to the doc and example config/code:

It’s not clear how to do this. What if I want to run multiple commands associated to when (on success/fail)? Basically I want to combine the shorthand syntax for running multiple commands with the when attribute. What’s the syntax for that combination?


I’d try dropping the bar and then chaining the commands in a single line:

sudo -u root createuser -h localhost --superuser ubuntu && sudo createdb -h localhost test_db

Then you can add a when to it.


I figured so, but would that result in a long line if you have quite a few lengthy commands? Or I suppose in that case best to put commands in a shell script in repo, then call that script to run through the commands?


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.