Re: Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
> > Ah great, exactly what I was looking for, I also realised I'd also be > better parsing the string before parsing the JSON, rather than the other > way round, simplifies it a lot. :) > Thanks again. -- You received this message because you are subscribed to the Google Groups "Jenkins Us

Re: Json and dynamic variables

2016-02-18 Thread Ioannis Moutsatsos
I see. In that case the 'groovy' way to do this is the SimpleTemplateEngine [1] http://docs.groovy-lang.org/latest/html/api/groovy/text/SimpleTemplateEngine.html Hope it helps! Ioannis On Thursday, February 18, 2016 at 9:47:11 AM UTC-5, Niksan wrote: > > Thanks for that, I'm only interested in

Re: Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
> > Thanks for that, I'm only interested in reading though, I came up with a > solution although I'm rusty with Groovy but it will make do until a better > approach appears. > This method enables me to write test json in the console for test purposes. def token1 = 'Replaced-Token1' def token2 =

Re: Json and dynamic variables

2016-02-18 Thread Ioannis Moutsatsos
I have been experimenting with the groovy JsonBuilder[1] and I find it quite capable in generating dynamic JSON. I'm not aware of any Jenkins plugin for what you are looking for though. [1] http://docs.groovy-lang.org/latest/html/gapi/groovy/json/JsonBuilder.html Cheers Ioannis On Thursday, Feb

Json and dynamic variables

2016-02-18 Thread 'Niksan' via Jenkins Users
I have a job which has a groovy script and inside there I have a JSON like array which I parse, I'd like to offload this array to a JSON file on disk but it contains some elements that are gathered from parameters for the job. What's the best way of injecting / replacing tokens in a JSON file th