Aleksandar Kostadinov
unread,Sep 28, 2020, 6:09:22 PM9/28/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkins...@googlegroups.com
Hi,
I'd like to obtain some information about pipeline files I have in our
repository. Such information is whether the pipeline is declarative,
whether it defines parameters, list parameter names and similar.
So I'm trying to create a CST or AST that I can scan through to see
certain properties of these pipelines.
After looking at the available options I tried the following:
> groovy:000> parser = SourceUnit.create("some.jenkinsfile", s, /*tolerance*/ 1)
> groovy:000> parser.parse()
===> null
groovy:000> parser.getCST()
===> null
> groovy:000> parser.getConfiguration().getPluginFactory().createParserPlugin().parseCST(parser, new StringReader(s));
===> null
`s` is the string source of the pipeline. Basically parses to nothing.
Can anybody advise me how to do it?
Thank you.