#!/usr/bin/env python3 from jinja2 import Template, Environment, FileSystemLoader pipelines = [ { "group": "debian", "tags": [ "ubuntu-22.04", "ubuntu-20.04", "ubuntu-18.04", "ubuntu-16.04", "ubuntu-14.04", "debian-8", "debian-9", "debian-10" ] }, { "group": "rhel", "tags": [ "almalinux-8", "centos-7", "fedora-34", "fedora-35", "fedora-36", "fedora-37" ] }, { "group": "alpine", "tags": [ "alpine-3.14", "alpine-3.15" ] }, { "group": "arch", "tags": [ "arch" ] } ] file_loader = FileSystemLoader('.') env = Environment(loader=file_loader) template = env.get_template('drone.yaml.j2') output = template.render(pipelines=pipelines) print(output)