Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toolsascode/gomodeler
Go Modeler is a small CLI and Library that brings the powerful features of the golang template into a simplified form.
https://github.com/toolsascode/gomodeler
ci cloud devops github-actions infra it pipeline platform sre
Last synced: 2 months ago
JSON representation
Go Modeler is a small CLI and Library that brings the powerful features of the golang template into a simplified form.
- Host: GitHub
- URL: https://github.com/toolsascode/gomodeler
- Owner: toolsascode
- License: mit
- Created: 2024-09-03T18:12:38.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-07T08:44:56.000Z (4 months ago)
- Last Synced: 2024-10-21T19:44:38.427Z (3 months ago)
- Topics: ci, cloud, devops, github-actions, infra, it, pipeline, platform, sre
- Language: Go
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Go Modeler CLI and Library
[![Go Reference](https://pkg.go.dev/badge/github.com/toolsascode/gomodeler.svg)](https://pkg.go.dev/github.com/toolsascode/gomodeler) [![Dependabot Updates](https://github.com/toolsascode/gomodeler/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/toolsascode/gomodeler/actions/workflows/dependabot/dependabot-updates) [![Testing](https://github.com/toolsascode/gomodeler/actions/workflows/go.yml/badge.svg)](https://github.com/toolsascode/gomodeler/actions/workflows/go.yml) [![Publishing Version](https://github.com/toolsascode/gomodeler/actions/workflows/releaser.yml/badge.svg)](https://github.com/toolsascode/gomodeler/actions/workflows/releaser.yml)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](https://masterminds.github.io/sprig/) project to help you with the maximum resources available by the communities.
## How to install?
### Go Install
```shell
go install github.com/toolsascode/gomodeler@latest
```### Via Github
- [Latest version](https://github.com/toolsascode/gomodeler/releases/latest)
```shell
curl -fLSs https://raw.githubusercontent.com/toolsascode/gomodeler/main/scripts/install.sh | bash
```Or
```shell
curl -fLSs https://raw.githubusercontent.com/toolsascode/gomodeler/main/scripts/install.sh | sudo bash
```### Homebrew
```shell
brew install toolsascode/tap/gomodeler
```### Scoop
1. Run **PowerShell as an Administrator** and:
2. To add this bucket, run `scoop bucket add gomodeler-scoop https://github.com/toolsascode/scoop-bucket`.
3. To install, do `scoop install gomodeler`._*Soon we will be making it available through other installation sources._
## How to use?
See full documentation at [gomodeler.md](./docs/gomodeler.md)
1. Create a structure.
**Example:**```shell
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}_2. Create templates using the following available resources:
1. [Go template](https://pkg.go.dev/text/template#hdr-Actions)
2. [GoModeler Funcs](./docs/functions.md)
3. [Sprig](https://masterminds.github.io/sprig/)3. Create a variables file in `Yaml` or `Json` format. It is also possible to pass the variables directly to the CLI in the `key=value` format.
- **Example:** `envFile.yaml`
4. Run the command with the following options:```shell
gomodeler -f root/envFile.yaml --template-path root/templates --output-path root/outputs
```5. Just check the `root/outputs` folder where all files will be generated.
## Examples
In the [examples](./examples/) folder, some examples and models of how to use the CLI are available.
- [Complete](./examples/complete/)
- [Summary](./examples/summary/)
- [Multiple templates](./examples/multiple-templates/)For more options run the `gomodeler --help` command or use `gomodeler [command] --help` for more information about a command. See [gomodeler.md](./docs/gomodeler.md)