Skip to content

Recursively merge yaml files without external dependencies

Notifications You must be signed in to change notification settings

benprofessionaledition/yamlmerge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yamlmerge

This is a simple tool that recursively merges two root nodes of a yaml tree and spits the output to stdout. While this isn't exactly rocket science, and can be accomplished easily with Python or Perl, this project is written in Go so that it can be compiled to a small standalone binary suitable for use in containers.

Installation

First you need to install Go 1.12+

To compile the code:

make all

This will detect your OS (MacOS or Linux only) and put a binary in bin/yamlmerge

Usage

Given a file app.yaml that looks like this:

default:
  port: 5000
  endpoint: http://foo.com
  
prod:
  endpoint: http://prod.foo.com
      
test:
  endpoint: http://test.foo.com

run ./yamlmerge app.yaml default test >> configurations/test.yaml to make a configurations/test.yaml that looks like this:

port: 5000
endpoint: http://test.foo.com

That's it. No Helm, no ktempl, no config servers, no Python, just a binary.

About

Recursively merge yaml files without external dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published