The objective of this project is to help those people who need a small software to carry out their template compilations easily and quickly. The version is available to be used as a small CLI or a library in golang
. We use Golang's templating system to perform the main demands of the application.
In this project we also have a set of our own functions and the phenomenal arrangement of the Sprig project to help you with the maximum resources available by the communities.
go install github.com/toolsascode/gomodeler@latest
curl -fLSs https://raw.githubusercontent.com/toolsascode/gomodeler/main/scripts/install.sh | bash
Or
curl -fLSs https://raw.githubusercontent.com/toolsascode/gomodeler/main/scripts/install.sh | sudo bash
brew install toolsascode/tap/gomodeler
- Run PowerShell as an Administrator and:
- To add this bucket, run
scoop bucket add gomodeler-scoop https://github.com/toolsascode/scoop-bucket
. - To install, do
scoop install gomodeler
.
*Soon we will be making it available through other installation sources.
See full documentation at gomodeler.md
-
Create a structure. Example:
root/ /templates/ file1.json.gotmpl file2.yaml.gotmpl file3.md.gotmpl file4.html.gotmpl /envFile.yaml
*An important point is the file format, it is not mandatory, it avoids the need to inform each name for the output.
- Template file name format: {filename}.{extension to output}.{extension to template}
- The following file will be generated automatically by the output: {filename}.{extension to output}
-
Create templates using the following available resources:
-
Create a variables file in
Yaml
orJson
format. It is also possible to pass the variables directly to the CLI in thekey=value
format.- Example:
envFile.yaml
- Example:
-
Run the command with the following options:
gomodeler -f root/envFile.yaml --template-path root/templates --output-path root/outputs
- Just check the
root/outputs
folder where all files will be generated.
In the examples folder, some examples and models of how to use the CLI are available.
For more options run the gomodeler --help
command or use gomodeler [command] --help
for more information about a command. See gomodeler.md