read yaml from groovy

1,132 views
Skip to first unread message

Azul Inho

unread,
Jan 29, 2016, 12:25:12 PM1/29/16
to job-dsl-plugin
Hi there,

Is there a nice, clean way of reading a yaml file using groovy and the DSL ?
Right now we're using a dodgy python hack, which is not very pretty

thanks

Rahul Mishra

unread,
Jan 29, 2016, 1:03:55 PM1/29/16
to job-dsl-plugin
I am using a slightly older version of the DSL , so i am not sure if there is a native support now.

I ended up using YAML Beans (https://github.com/EsotericSoftware/yamlbeans) within my DSL to read a YAML file. There are a few other options as well.

In YAML Beans, you work using the YAML Reader Abstraction and can load up your entire file into a vanilla map or a nested object structure as long as the keys match the property fields.

Regards,
Rahul 
Reply all
Reply to author
Forward
0 new messages