-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
helpers: Add a --jinja option to ynh_add_config #1851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed some improvements on doc side.
Tested on one of my apps it look good.
Thanks
Actually I got a request, here in pseudocode :
That would help using jinja2 for nginx/systemd/etc without having to add --jinja arguments to all the relevant helpers. |
Weeeeell yeah but on the other hand we should be careful and think about what we want exactly ... The current templating is okay-ish and I'm not sure there's a huge gain in moving to jinja for the vast majority of cases, and I'm not sure the syntax is gonna be "cleaner". For example for nginx conf, implementing the whole thing about Or to rephrase, I don't see the gain of reworking all the configs of every app. A lot of energy went into homogeneizing things, I don't feel like seeing a bunch of apps switching every conf to jinja2 just for the sake of it and ending up with heterogenous practices with no benefits To me this PR is about specific app configurations which are too complex to be handled by the "simplified templating" mechanism |
From my point of view I'm to migrate progressively everything to jinja for theses raison:
Note that this is only my personal point of view. I don't mind if we keep it as it is. I just share my point of view. |
Hello, Well, in any case I'm to merge this PR as it is. It still be already a good improvement. The discussion about this can be later, more on packaging v3 side. |
The problem
cf YunoHost-Apps/Experimental_helpers#111
Solution
add a
--jinja
option toynh_add_config
to render the template using jinja. All bash variables are exported in a subshell. The rendering is done usingj2cli
which is available in debian since bullseyePR Status
Tested using new unit tests
How to test
Try rendering a template using
ynh_add_config --template=foo --destination=bar --jinja