donovanmuller / spring-cloud-skipper-maven-plugin

Spring Cloud Skipper Maven plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mustache Issue: How do we set the application & deployment properties in the yml

menelaosbgr opened this issue · comments

Hi,

I saw that you are using the DefaultMavenFileFilter which I suspect is the mechanism that copies that maven project variables into the yml files.

However, the way the plugin is implemented... I can't understand how to add deployment and application properties ... how should we define them in the pom.xml for them to be copied over?

I can't see it right now, but I want to avoid changing your code to add one more step to do a further replacement using maybe parameters found in MavenModel.properties map.

Is there some kind of mustache replacement mechanism in place?

Thank you in advance!

Hi @menelaosbgr,

I'm assuming you would like to bake in some default application/deployment properties into your Skipper package in addition to supporting those properties passed in when deploying with Skipper.

The current way to do that is to include your own templates/template.yml in the src/main/resources/META-INF/skipper of your app you are building the Skipper package for. This file will override the default template.yml (see the overrideDirectory under the optional parameters).
Also see here in the example Skipper app from the blog post, which does this already.

Below is an example of what that template.yml could look like:

...
  applicationProperties:
    xxx: yyy
    {{#spec.applicationProperties.entrySet}}
    {{key}}: {{value}}
    {{/spec.applicationProperties.entrySet}}
  deploymentProperties:
    zzz: aaa
    {{#spec.deploymentProperties.entrySet}}
    {{key}}: {{value}}
    {{/spec.deploymentProperties.entrySet}}

This would allow for the custom properties xxx and zzz (which I'm assuming you want this package to have by default) but also support additional properties passed in at deployment time.

@donovanmuller Thank you for the response.

I was curious though, it seems almost as if spec.deploymentProperties is an entrySet/arrayList .
Is there a way to set these collections in another manner? Instead of having to enter xxx and yyy ?