On Thu, Aug 27, 2020 at 8:58 AM Michael Carter
<
mikeyca...@gmail.com> wrote:
> [For a few] users I'm dumping the json to a flat file. So the freestyle users will just "cat <file> | jq ." field sort of thing. The pipeline scripted people will just "readJson" and be happy.
If the freestyle users can do what they need using the likes of `jq`,
then the Pipeline users can do the same in a `sh` step, right? The
only reason to load data into the Pipeline script (i.e., manipulate in
Groovy) is if it must be used as the input to some other step or
conditional, for which `readJson` suffices—or you can use
`returnStdout` on some call to `jq -r` and not even need that step.
> insist on scripted pipeline [yet] have to use two commands not one
You can always supply Groovy libraries which offer various
conveniences and idioms while keeping the actual `Step`s simple.