yaml-toolbox

module
v0.0.0-...-950ceb3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2020 License: Apache-2.0

README

YAML Toolbox

A collection of small YAML tools that can be used from the CLI or a GitHub Action

Splitter

Given a Kubernetes multi-doc YAML file, split the file into separate files.

The following GitHub Action workflow will split the contents of api.yaml into separate documents, in the api directory. The filenames will be [metadata.name]-[kind].yaml.

      - name: Split the api doc
        uses: marccampbell/yaml-toolbox/action/split@master
        with:
          path: ./api.yaml
          out: ./api
Remarshaler

Given a YAML document or a directory of YAML documents, unmarshal and remarshal to create deterministic YAML. This reorders the YAML document to be consistent, and thereby creates smaller diffs. It also (importantly) doesn't wrap lines at 80 chars, which is useful when using a template functions in YAML for tools such as KOTS or Helm.

The following GitHub Action workflow will remarshal all of the documetns in the kots directory:

      - name: Remarshal the release
        uses: marccampbell/yaml-toolbox/action/remarshal@master
        with:
          path: ./kots

Directories

Path Synopsis
cmd
cli
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL