Skip to content

Commit

Permalink
Add plone-site template configuration to mx.ini template.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Jun 15, 2024
1 parent 2ad9807 commit 01a6ee0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
5 changes: 1 addition & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## 1.0a6 (unreleased)


- Nothing changed yet.

- Add `plone-site` template configuration to `mx.ini` template.

## 1.0a5 (2024-06-07)

Expand All @@ -25,7 +23,6 @@

- Add Plone site creation and purging in new `plone` domain.


## 1.0a4 (2024-03-12)

- Add experimental windows support.
Expand Down
11 changes: 9 additions & 2 deletions src/mxmake/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,16 @@ def template_variables(self) -> typing.Dict[str, typing.Any]:
mxmake_templates = []
for domain in self.domains:
if domain.fqn == "qa.test":
mxmake_templates.append("run-tests")
template = dict(name="run-tests", settings=dict(environment="env"))
mxmake_templates.append(template)
if domain.fqn == "qa.coverage":
mxmake_templates.append("run-coverage")
template = dict(name="run-coverage", settings=dict(environment="env"))
mxmake_templates.append(template)
if domain.fqn == "applications.plone":
template = dict(
name="plone-site", settings=dict(distribution="default")
)
mxmake_templates.append(template)
return dict(mxmake_templates=mxmake_templates)


Expand Down
8 changes: 5 additions & 3 deletions src/mxmake/templates/mx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ version-overrides =
# templates to generate
mxmake-templates =
{% for template in mxmake_templates %}
{{ template }}
{{ template["name"] }}
{% endfor %}

# environment variables
[mxmake-env]
# VAR = value

{% for template in mxmake_templates %}
[mxmake-{{ template }}]
environment = env
[mxmake-{{ template["name"] }}]
{% for key, value in template["settings"].items() %}
{{ key }} = {{ value }}
{% endfor %}

{% endfor %}
{%- endif %}
5 changes: 5 additions & 0 deletions src/mxmake/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ def test_MxIni(self, tempdir):
domains = [
topics.get_domain("qa.test"),
topics.get_domain("qa.coverage"),
topics.get_domain("applications.plone"),
]
domains = topics.collect_missing_dependencies(domains)

Expand All @@ -805,13 +806,17 @@ def test_MxIni(self, tempdir):
# templates to generate
mxmake-templates =
plone-site
run-coverage
run-tests
# environment variables
[mxmake-env]
# VAR = value
[mxmake-plone-site]
distribution = default
[mxmake-run-coverage]
environment = env
Expand Down

0 comments on commit 01a6ee0

Please sign in to comment.