Skip to content

Simple CLI tool to replace tokens with environment values

Notifications You must be signed in to change notification settings

Heathland/token_replace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Replace

This CLI tool is created to help CI/CD pipeline developers to locally test functions normally used in pipelines where token replacements are being used.
The tool replaces all tokens found in the input file with the environment variables of similar name.

Syntax

Using a file as input:

$ TEST=foobar token_replace -f examples/standard.yaml
value: foobar

Using pipe as input:

$ cat examples/standard.yaml | TEST=foobar token_replace -f -
value: foobar

It uses the token format as #{TOKEN_NAME#}#. It is also possible to your own custom tokens.
You can set these using the following flags startToken and endToken. Example:

$ TEST=foobar token_replace -f examples/custom.yaml -startToken "_+" -endToken "+_"
value: foobar

About

Simple CLI tool to replace tokens with environment values

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages