Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to include common code into velocity templates #144

Open
netwolfuk opened this issue Jul 11, 2019 · 4 comments
Open

Add ability to include common code into velocity templates #144

netwolfuk opened this issue Jul 11, 2019 · 4 comments

Comments

@netwolfuk
Copy link
Member

There should be a way to "include" code in a velocity template.

Currently any macros need to be added to the top of every event template.

Velocity supports including other files, I just need to figure out a way to do with without actual files.

@netwolfuk
Copy link
Member Author

netwolfuk commented Jul 11, 2019

Incudes could simply appear like normal buildstate templates, but have a type to identify them as such, and an ID so they can be included by reference.

@Super8film87
Copy link

Would it be possible to share macros and use them without defining them in the template self?

@netwolfuk
Copy link
Member Author

@Super8film87 where do you imagine they would be stored if not in the template?

Would you want macros available to multiple templates? I've been thinking about this and haven't come up with an elegant solution for that.

@Super8film87
Copy link

So right now I work on a centralized template for all our projects -> single source & send all data to elasticsearch (thats the reason why I send all parameters)

-> sharing macros could enable to share same data over multiple templates e.g. product ,infra, dev -> more modularity to the needs of the different users. Also possible to create a modular template with macros

{
"template_id2" : "DevTemplate", //custom
#add.BuildMeta() //refers to other template BuildMeta
#add.AgentMeta() //refers to other template AgentMeta
"triggered_by": "${triggeredBy}"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants