GithubHelp home page GithubHelp logo

jthan24 / yamine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avencera/yamine

0.0 0.0 0.0 51 KB

A simple CLI for combining json and yaml files

License: Apache License 2.0

Rust 63.74% Shell 36.26%

yamine's Introduction

yamine Mean Bean CI

A simple CLI for combining json and yaml files

Install

Available via Homebrew/Linuxbrew

brew install avencera/yamine/yamine

or

Install from a github release:

curl -LSfs https://avencera.github.io/yamine/install.sh | sh -s -- --git avencera/yamine

or

Download a release directly from github: github.com/avencera/yamine/releases

Usage

yamine --help

Combine JSON/YAML files into a single file

USAGE:
    yamine [FLAGS] [OPTIONS] <FILES_OR_FOLDERS>...

FLAGS:
        --dry-run    Default mode
    -h, --help       Prints help information
    -s, --std-out    Outputs combined file contents to STDOUT
    -V, --version    Prints version information
    -w, --write      Write new output file

OPTIONS:
    -d, --depth <depth>      Number of folder depth to recurse into [default: 1]
    -f, --format <format>    The format for the output file, defaults to yaml, options are: 'yaml', 'json', 'k8s-json'
                             [default: yaml]
    -o, --output <output>    Output file name [default: combined.yaml]

ARGS:
    <FILES_OR_FOLDERS>...    File(s) or folder you want to run in

Examples

  • Combine all yaml and json files in the current folder and creates combined.yaml file
    • yamine -w .
  • Combine all yaml and json files in the current folder and creates a combined.json file in json-k8s format:
    • yamine --write --format json-k8s --output combined.json .
  • Output the combined file to STDOUT in json-array format:
    • yamine --std-out -f json-array .

Formats

  • yaml - a multi document yaml file separated by --- (a kubernetes multi resource document)

    ---
    apiVersion: traefik.containo.us/v1alpha1
    kind: IngressRoute
    ---
    apiVersion: v1
    kind: Namespace
    metadata:
      name: example
    ---
    kind: ServiceAccount
    apiVersion: v1
    ---
    apiVersion: v1
    kind: Service
    ---
    apiVersion: apps/v1
    kind: Deployment
  • json-array - a json file with each combined file being an element in the array

    [
        {
          "apiVersion": "traefik.containo.us/v1alpha1",
          "kind": "IngressRoute"
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "Namespace",
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "ServiceAccount",
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "Service",
          ...
        },
    ]
  • json-k8s - a kubernetes multi resource json document ex:

    {
      "kind": "List",
      "apiVersion": "v1",
      "items": [
        {
          "apiVersion": "traefik.containo.us/v1alpha1",
          "kind": "IngressRoute"
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "Namespace",
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "ServiceAccount",
          ...
        },
        {
          "apiVersion": "v1",
          "kind": "Service",
          ...
        },
      ]
    }

yamine's People

Contributors

praveenperera avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.