1.1.3 • Published 10 months ago

@dsolodky/yaml-envsubst v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

yaml-envsubst

envsubst tool for yaml files (especially for kubernetes yaml files)

This tool is created in order to substitute envrionment varibales inside the Kubernetes yaml templates during the Gitlab CI job execution.

You can have two variants: 1. Substitute values or part of values.

test: ${MYVAR}
test2: ${MYVAR}-some text
test3: ${MULTILINE_VAR}

in case if you set your environment like that:

export MYVAR=First value
export MULTILINE_VAR="First line
second line"

You will get this yaml as an output:

test: First value
test2: First value-some text
test3: |-
       First line
       second line
  1. Substitute complete key:
${test}:
    innerKey: value
anotherKey: value

so you can define the env variables test as:

key1: 
    otherKey: value
    otherKey2: value

as aa result you will get:

key1: 
    otherKey: value
    otherKey2: value
    innerKey: value
anotherKey: value

A variable value may contain another variable, which is also supported.

Installation

npm install -g @dsolodky/yaml-envsubst

You will probably want to add it to you docker file.

RUN apk add --update npm
RUN npm install -g @dsolodky/yaml-envsubst

Usage

The tool expects two command line arguments

yaml-envsubst ./kubernetes-template.yaml ./kubernetes.yaml
1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago