Thursday, 2024-08-08

toabctlis there a way to include from a file content which is then passed to "j2-yaml" ?10:53
toabctlso 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
toabctlvsevolod, do you know ? ^^10:57
toabctlI wonder if we would like to add something like "!include-j2-yaml"  ...10:58
vsevolodtoabctl, you may use !include-jinja2: tag11:02
vsevolodhttps://jenkins-job-builder.readthedocs.io/en/latest/definition.html#inclusion-tags11:03
toabctlvsevolod, but that doesn't return a yaml structure11:04
toabctlit just returns a string iirc11:04
vsevolodI see11:05
vsevolodand plain !include: does not expand yaml inside included text?11:05
toabctlI need a jinja file that returns yaml11:06
vsevolodGot it. Looks like there no such tag.11:06
toabctlso exactly what "j2-yaml" does. but the content should be read from a file11:06
toabctlack11:06
vsevolodYou can try adding one. Look for examples in jenkins_jobs/yaml_objects.py file.11:08
vsevolodJust don't forget to add tests as well.11:08
toabctlyeah :)11:08
toabctlnot sure if I get enough time to add this. but if I'll have time, I for sure will also add tests :)11:09
vsevolodyeah. Time is never enough :)11:09

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!