On Mon, Mar 19, 2018 at 04:46:44PM +0000, Tim Jaacks wrote:
On 19 March 2018 at 16:26, Neil Williams <neil.williams at linaro.org> wrote:
Templating.
Check out how Jinja2 is used for the server-side device configuration templates - Jinja2 can output any text-based format, we chose YAML. The same principles are used by the Linaro QA team to produce the test job submissions. Templates live in version control, the commit hash of the template gets included into the metadata of the output.
That’s a very good hint, thank you. I haven’t thought of this, yet. Are the repositories containing your templates publicly available?
Hi Tim -
Here's an example of generating lava templates using jinja2. It's probably more complicated than you need.
See https://git.linaro.org/ci/job/configs.git/tree/openembedded-lkft/lava-job-de... for a directory of templates, and see https://git.linaro.org/ci/job/configs.git/tree/openembedded-lkft/submit_for_... for the python code that does the generation. Lastly, you can run https://git.linaro.org/ci/job/configs.git/tree/openembedded-lkft/test_submit... and it will generate all of the YAML files into "./tmp".
Like I said, this is likely more complicated than you are looking for. I suggest starting simpler using https://pypi.python.org/pypi/jinja2-cli/0.6.0.
Dan