I may have answered my own question. Don't use a template. I have instead
created a Groovy class and I call it from the Pre-send Script area using
the GroovyClassLoader. This allows me to use it with other scripts and
creates an incredibly dynamic tool. I can now post to Jive systems via
automated emails without all the errors that are so common.
On Wednesday, December 4, 2013 10:37:37 AM UTC-6, Daniel Barker wrote:
>
> I have successfully written a well-functioning Groovy script to format my
> email content for a Jive type social site after the great help from this
> group. Now, I want others to be able to add or remove parts based on adding
> a Set of regex patterns that will be applied to the log to eliminate or
> keep parts of the log for specific uses. My script will be used throughout
> my organization, so modifying it isn't the best option, especially if
> others won't know how to do it.
>
> I want consumers to be able to create a Set object that contains regex
> patterns like "^\\d{2}:\\d{2}:\\d{2}\$" to eliminate lines that only have
> a timestamp or "[WARNING]" if a user wants to remove lines that include
> this tag. My script will then check this set and run through each entry
> applying the changes to the log output.
>
> I originally thought I could just include a def inside <% %> to create a
> set and then use it within my script, but that just prints the line. I
> thought about creating a separate script with just that line, but I'm not
> sure that will work, and it isn't optimal. I also tried the same line
> without <% %>. I then tried the ${ENV,var="VARIABLENAME"} syntax, but
> that didn't work. Probably because I'm not really sure how to use it
> properly. I'm also not sure that would allow me to pass a Set or Array or
> List or any collection. I've read that creating a variable in the build
> environment won't pass it to the post-build actions, but I haven't tried it.
>
> Any help would be greatly appreciated.
>
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.