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

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

View File

@@ -33,7 +33,7 @@ pipelines:
fi
- parallel:
{% for spath in scenario_paths -%}
{% for spath in scenario_paths %}
- step:
name: {{ spath.parts[2] }}/{{ spath.parts[4] }}
services:
@@ -49,8 +49,8 @@ pipelines:
services:
- docker
script:
- ./bin/install-ansible --dev
- apt-get update && apt-get install -y npm
- npm install -g snyk
- snyk auth $SNYK_TOKEN
- pipenv run snyk test --severity-threshold=high
- ./bin/install-ansible --dev
- apt-get update && apt-get install -y npm
- npm install -g snyk
- snyk auth $SNYK_TOKEN
- pipenv run snyk test --severity-threshold=high