toabctl | is there a way to include from a file content which is then passed to "j2-yaml" ? | 10:53 |
---|---|---|
toabctl | so basically read the content for "!j2-yaml: |" from a file instead of writing it down directly. reading from a file has the advantage that I could reuse the same file in different places... | 10:54 |
toabctl | vsevolod, do you know ? ^^ | 10:57 |
toabctl | I wonder if we would like to add something like "!include-j2-yaml" ... | 10:58 |
vsevolod | toabctl, you may use !include-jinja2: tag | 11:02 |
vsevolod | https://jenkins-job-builder.readthedocs.io/en/latest/definition.html#inclusion-tags | 11:03 |
toabctl | vsevolod, but that doesn't return a yaml structure | 11:04 |
toabctl | it just returns a string iirc | 11:04 |
vsevolod | I see | 11:05 |
vsevolod | and plain !include: does not expand yaml inside included text? | 11:05 |
toabctl | I need a jinja file that returns yaml | 11:06 |
vsevolod | Got it. Looks like there no such tag. | 11:06 |
toabctl | so exactly what "j2-yaml" does. but the content should be read from a file | 11:06 |
toabctl | ack | 11:06 |
vsevolod | You can try adding one. Look for examples in jenkins_jobs/yaml_objects.py file. | 11:08 |
vsevolod | Just don't forget to add tests as well. | 11:08 |
toabctl | yeah :) | 11:08 |
toabctl | not sure if I get enough time to add this. but if I'll have time, I for sure will also add tests :) | 11:09 |
vsevolod | yeah. Time is never enough :) | 11:09 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!