Skip to content

YAML is hard when files tend to increase their size, this tool allow you to have multiple files with a simple structure that help you manage big files in to little ones.

License

Notifications You must be signed in to change notification settings

Joxebus/yaml-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yaml-compose

This project was created to solve a common problem when working with YAML files, my intention with this tool is to instead having a big YAML file we are able to have little ones and merge in a single file with a very simple structure.

The script is written in Groovy so you need to verify if you have installed in your path.

Usage

Think in the following sample where you have some yaml files

sample-1.yml

property-1:
    something: 'value'
property-2:
    something-else: 'another-value'

And in another file you have this:

sample-2.yml

property-3:
    something: 'new value'

If you want to create a single file create a template like this:

my-custom-template.yml

my-common-property: 'sample'
another-common: 'whatever you want'

list-of-includes:
    $include: sample-1.yml
    $include: sample-2.yml

The $include will be replaced by the file and will use the same level where was found.

yaml-compose -i my-custom-template.yml

The result will be created on the same directory in the fileoutput.yml

my-common-property: 'sample'
another-common: 'whatever you want'

list-of-includes:
    property-1:
        something: 'value'
    property-2:
        something-else: 'another-value'
    property-3:
        something: 'new value'

To see some more complex sample look at sample folder.

Parameters

> yaml-compose -h

usage: yaml-compose -[hvroi]
 -h,--help           Usage Information
                     
 -i,--input <arg>    name of the yaml file to process [required]
 -o,--output <arg>   output filename by default output.yml
 -r,--recursive      recursively look in the other files for inclusions
 -v,--version        shows the version of the script

Install

Download the project and the give execution permission to the yaml-compose script.

chmod +x yaml-compose

If you want to have available the script in your system you can copy this to your /usr/local/bin

Note: This tool is still on beta if you want to contribute please contact me http://joxebus.github.io

About

YAML is hard when files tend to increase their size, this tool allow you to have multiple files with a simple structure that help you manage big files in to little ones.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages