Crates.io | tmptoml |
lib.rs | tmptoml |
version | 0.1.3 |
source | src |
created_at | 2022-03-16 22:20:23.783201 |
updated_at | 2022-03-22 00:56:52.797194 |
description | Renders Tera templates using a toml config file as the variable source. |
homepage | https://github.com/uptech/tmptoml |
repository | https://github.com/uptech/tmptoml |
max_upload_size | |
id | 551487 |
size | 34,830 |
Renders Tera templates using a toml config file as the variable source.
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
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.
Secondary Sections
Secondary sections are used to define the specifics for each service/system.
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.
TmpToml
is Copyright © 2022 Uptech Works LLC. It is free software, and
may be redistributed under the terms specified in the LICENSE file.
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.