tmptoml

Crates.iotmptoml
lib.rstmptoml
version0.1.3
sourcesrc
created_at2022-03-16 22:20:23.783201
updated_at2022-03-22 00:56:52.797194
descriptionRenders Tera templates using a toml config file as the variable source.
homepagehttps://github.com/uptech/tmptoml
repositoryhttps://github.com/uptech/tmptoml
max_upload_size
id551487
size34,830
Jon Holtan (chillbrodev)

documentation

README

TmpToml

Renders Tera templates using a toml config file as the variable source.

Installation

First and foremost you will need to install Rust, recommended via Homebrew:

brew install rust

Then build the tool:

cargo build

OR run the tool directly:

cargo run config.toml template.yaml qa system1

TmpToml Breakdown

Config.toml

config.toml is the main configuration file for the tool. It contains the variables and values that are used to render the templates. This file contains PUBLIC values that can be checked into source control. This file contains the following sections and secondary sections:

Sections

Sections are used to define the environment and anything that is shared amongst the templates.

  • qa
  • production

Secondary Sections

Secondary sections are used to define the specifics for each service/system.

  • system1
  • system2

Templates

Each template file contains variables and values are defined in the config.toml file. Variables are specificed using the {{variableName}} syntax. If a variable exists in the templated file but not in the config.toml, TmpToml will throw an error and the template will not be rendered. If a variable exists in the config.toml file but not in the referenced templated file, TmpToml will still render the template.

Example:

First render the template:

./tmptoml config.toml template.yaml qa system1

The breakdown of the above command:

  • ./tmptoml is the TmpToml binary.
  • config.toml is the path to the configuration file.
  • template.yaml is the path to the template file.
  • qa is the primary section/environment.
  • system1 is the name of the secondary section.

TmpToml renders the template file to STDOUT.

License

TmpToml is Copyright © 2022 Uptech Works LLC. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About uptech studio

TmpToml is maintained and funded by Uptech Studio, a software design & development agency & consultancy.

We love open source software. See our other projects or hire us to design, develop, and grow your product.

Commit count: 13

cargo fmt