Skip to content

small utility to patch config file in different format by using yaml patch expression

License

Notifications You must be signed in to change notification settings

orange-cloudfoundry/config-patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

config-patcher

small utility to patch config file in different format by using yaml patch expression which can be found on this link: https://github.com/krishicks/yaml-patch .

Config-patcher support these formats as config input:

  • json
  • yaml
  • toml

Installation

Config-patcher has been made to work during a bosh lifecycle and should be used through its boshrelease: https://github.com/orange-cloudfoundry/config-patcher-boshrelease

You can use by cli, by using go get https://github.com/orange-cloudfoundry/config-patcher

Usage of ./config-patcher:
  -patch string
    	Set in glob format where to find rules for patching config files (default "/var/vcap/jobs/*/config-patcher/*.yml")

Patch format

Create a yaml file in this format (which is accessible which -patch flag):

- config_file: <config-file> # config file in input which will be patched
  config_type: <json | yaml | toml> # this is actually not mandatory, but you could need to set explicitly type of your config file
  patches:
    - op: <add | remove | replace | move | copy | test>
      from: <source-path> # only valid for the 'move' and 'copy' operations
      path: <target-path> # always mandatory
      value: <any-yaml-structure> # only valid for 'add', 'replace' and 'test' operations

About

small utility to patch config file in different format by using yaml patch expression

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages