Skip to content

Instantly share code, notes, and snippets.

@betaboon
Created November 9, 2018 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betaboon/bb0f7382993b8553d667d5644d0056e0 to your computer and use it in GitHub Desktop.
Save betaboon/bb0f7382993b8553d667d5644d0056e0 to your computer and use it in GitHub Desktop.
{
patchPhase = ''
${python3}/bin/python - << EOF
import yaml
import json
def yaml2json(yaml_file, json_file):
with open(yaml_file, "r") as i, open(json_file, "w") as o:
o.write(json.dumps(yaml.load(i.read())))
yaml2json("apm-server.yml", "apm-server.json")
yaml2json("fields.yml", "fields.json")
EOF
cat apm-server.json
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment