Giter Site home page Giter Site logo

humanize-manifest's Introduction

Humanize BOSH Manifest

Convert a BOSH deployment manifest created by bosh interpolate (where keys are sorted in alphabetical order) into a human-friendly readable format.

The latests BOSH v2.0 deployment manifest schema is primarily supported, but v1 is also supported, and bosh create-env (formely known as bosh-init) specificities are also supported.

This also basically works for old v1 manifests created by spiff or spruce because v1 schema is supported.

Usage

The command just takes a manifest as argument and writes the result to the standard output.

humanize-manifest machine-created-manifest.yml > human-readable-manifest.yml

The output will vary based on the manifest, but here is an example with a SHIELD v8 deployment manifests from the Easy Foundry distribution:

name: easyfoundry-shield-v8  # name comes first
instance_groups:
- name: shield               # name comes first
  instances: 1
  azs: [z1]                  # AZs are folded
  jobs:
  - name: core
    release: shield
    provides:
      shield:
        as: shield
        shared: true
    properties:
      # ...
  - name: shield-agent
    release: shield
    consumes:
      shield:
        instances:
        - address: shield-v8.easyfoundry.internal
        properties:
          domain: shield-v8.easyfoundry.internal
          port: 10443
    properties:
      core:
        ca: ((shield-tls.ca))
  stemcell: default
  vm_type: default
  vm_extensions:
  - shield-v8-loadbalancer
  persistent_disk_type: 1GB
  networks:
  - name: shield-v8-network
update:
  serial: true
  canary_watch_time: 1000-120000
  max_in_flight: 1
  update_watch_time: 1000-120000
variables:
- name: shield-agent-key
  type: ssh
- name: shield-ca
  type: certificate
  options:
    is_ca: true
    common_name: shieldca
- name: shield-tls
  type: certificate
  options:
    ca: shield-ca
    common_name: shield
    alternative_names:
    - 127.0.0.1
    - '*.shield.default.shield.bosh'
    - '*.shield.shield-v8-network.easyfoundry-shield-v8.bosh'
    - shield-v8.easyfoundry.prototyp.it
    extended_key_usage: [client_auth, server_auth]
- name: vault-ca
  type: certificate
  options:
    is_ca: true
    common_name: vaultca
- name: vault-tls
  type: certificate
  options:
    ca: vault-ca
    common_name: vault
    alternative_names:
    - 127.0.0.1
    - '*.vault.default.shield.bosh'
    - '*.vault.shield-v8-network.easyfoundry-shield-v8.bosh'
    extended_key_usage: [client_auth, server_auth]
releases:
- name: shield
  version: 8.0.8
  url: https://github.com/starkandwayne/shield-boshrelease/releases/download/v8.0.8/shield-8.0.8.tgz
  sha1: 55d1d6d8557f9b185fef7b5c6d73017b4c654f03
stemcells:
- alias: default
  os: ubuntu-trusty
  version: "3541.9"

Install

go get github.com/cloudfoundry-community/humanize-manifest

Contributing

If you modify this code, build it with:

go mod download
go build

And then test it with the -d debug flag:

humanize-manifest -d machine-created-manifest.yml 2>&1 | less

humanize-manifest's People

Contributors

bgandon avatar bertrand-lupart avatar drnic avatar gk-concourse-ninja avatar lnguyen avatar

Stargazers

Martin Jackson avatar  avatar

Watchers

Tyler Poland avatar  avatar Shawn Neal avatar James Cloos avatar  avatar Quintessence avatar  avatar Xiujiao Gao avatar DigitalEagle avatar  avatar  avatar

humanize-manifest's Issues

Ensure consistent ordering of additional keys

Currently, the additional keys that are not part of the known BOSH schemas are output in the same order as the input YAML.

This projects aims at providing a stable sorting of deployment manifests though. Thus, those keys should be sorted alphabetically instead of depending on the input.

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.