Skip to content

Commit

Permalink
feat: rename render-bundle to template2bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
micovery committed Apr 16, 2024
1 parent cf115da commit 5c831f7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ This toolkit includes tools that let you create API Proxy bundles based on popul
OpenAPI, GraphQL, gRPC, and more. Think of them as blueprints for your API Proxies.
* `render-template` - Renders a [Go-style](https://pkg.go.dev/text/template) template
* `render-bundle` - Combines `render-template` and `yaml2bundle` into one
* `template2bundle` - Combines `render-template` and `yaml2bundle` into one
**Why use templates?**
Expand Down Expand Up @@ -530,37 +530,37 @@ Here's how it works:
Sometimes, you might not want to deal with the intermediate YAML that gets created during the template
rendering process, and simply get an API Proxy bundle that is ready to be deployed.
For this use-case, you have the `render-bundle` tool. It combines both the `render-template`, and `yaml2bundle`
For this use-case, you have the `template2bundle` tool. It combines both the `render-template`, and `yaml2bundle`
functionality into a single tool. This is useful if you do not plan storing the rendered YAML in
source code, and you are simply interested on deploying the bundle artifact.
Below is an example of generating an API Proxy bundle directly from a template
```shell
render-bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-output ./out/bundles/petstore.zip
template2bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-output ./out/bundles/petstore.zip
```
Just like the `render-template`, and `yaml2bundle` tool this tool supports flags such as `-validate` and `-dry-run`
For example, the following command will print out the XML, but not create the bundle.
```shell
render-bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-dry-run "xml"
template2bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-dry-run "xml"
```
Or, if you want to peek and see what the intermediate YAML looks like, you can pass `-dry-run "yaml` like this:
Or, if you want to peek and see what the intermediate YAML looks like, you can pass `-dry-run "yaml"` like this:
```shell
render-bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-dry-run "yaml"
template2bundle -template ./examples/templates/oas3/apiproxy.yaml \
-set-oas spec=./examples/specs/petstore.yaml \
-include ./examples/templates/oas3/*.tmpl \
-dry-run "yaml"
```
## Installation
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export LD_FLAGS="-X main.BuildVersion=${VERSION} -X main.BuildTimestamp=${BUILD_
mkdir -p bin
echo "Building templating tools ..."
go build -ldflags "${LD_FLAGS}" -o bin/render-template ./cmd/render-template
go build -ldflags "${LD_FLAGS}" -o bin/render-bundle ./cmd/render-bundle
go build -ldflags "${LD_FLAGS}" -o bin/template2bundle ./cmd/template2bundle



Expand Down
2 changes: 1 addition & 1 deletion cmd/render-bundle/main.go → cmd/template2bundle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package main
import (
"flag"
"fmt"
"github.com/micovery/apigee-yaml-toolkit/cmd/render-bundle/resources"
"github.com/micovery/apigee-yaml-toolkit/cmd/template2bundle/resources"
"github.com/micovery/apigee-yaml-toolkit/pkg/flags"
"github.com/micovery/apigee-yaml-toolkit/pkg/render"
"github.com/micovery/apigee-yaml-toolkit/pkg/utils"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 5c831f7

Please # to comment.