Fix formatting.

This commit is contained in:
Steve Smith
2021-03-02 15:30:40 +11:00
parent 4a499ef020
commit a59b2b2f0f
3 changed files with 58 additions and 57 deletions

View File

@@ -346,7 +346,6 @@ pipelines:
- cd roles/restore_backups - cd roles/restore_backups
- pipenv run molecule test -s restore_jira_clustered - pipenv run molecule test -s restore_jira_clustered
- step: - step:
name: Run Snyk security scan name: Run Snyk security scan
services: services:

View File

@@ -1,4 +1,4 @@
from jinja2 import Template import jinja2 as j2
from pathlib import Path from pathlib import Path
import os import os
@@ -14,14 +14,16 @@ def find_all_scenarios():
def load_template(): def load_template():
path = Path(os.path.join(os.path.dirname(__file__), PIPELINE_TEMPLATE_J2_FILE)) jenv = j2.Environment(
return Template(path.read_text()) loader=j2.FileSystemLoader('.'),
lstrip_blocks=True,
trim_blocks=True)
return jenv.get_template(PIPELINE_TEMPLATE_J2_FILE)
def main(): def main():
template = load_template()
scenario_paths = find_all_scenarios() scenario_paths = find_all_scenarios()
template = load_template()
generated_output = template.render(scenario_paths=scenario_paths) generated_output = template.render(scenario_paths=scenario_paths)
print(generated_output) print(generated_output)

View File

@@ -33,7 +33,7 @@ pipelines:
fi fi
- parallel: - parallel:
{% for spath in scenario_paths -%} {% for spath in scenario_paths %}
- step: - step:
name: {{ spath.parts[2] }}/{{ spath.parts[4] }} name: {{ spath.parts[2] }}/{{ spath.parts[4] }}
services: services: