From 5c831f797cfbb30f4998f0c97ddb1de7822b93da Mon Sep 17 00:00:00 2001 From: Miguel Mendoza Date: Mon, 15 Apr 2024 20:56:50 -0700 Subject: [PATCH] feat: rename render-bundle to template2bundle --- README.md | 30 +++++++++---------- build.sh | 2 +- .../main.go | 2 +- .../resources/resources.go | 0 .../resources/usage.txt | 0 5 files changed, 17 insertions(+), 17 deletions(-) rename cmd/{render-bundle => template2bundle}/main.go (96%) rename cmd/{render-bundle => template2bundle}/resources/resources.go (100%) rename cmd/{render-bundle => template2bundle}/resources/usage.txt (100%) diff --git a/README.md b/README.md index 61a8706..fa05871 100644 --- a/README.md +++ b/README.md @@ -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?** @@ -530,17 +530,17 @@ 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` @@ -548,19 +548,19 @@ Just like the `render-template`, and `yaml2bundle` tool this tool supports flags 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 diff --git a/build.sh b/build.sh index 98c80ed..ee1e116 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/cmd/render-bundle/main.go b/cmd/template2bundle/main.go similarity index 96% rename from cmd/render-bundle/main.go rename to cmd/template2bundle/main.go index 7cd3100..647352a 100644 --- a/cmd/render-bundle/main.go +++ b/cmd/template2bundle/main.go @@ -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" diff --git a/cmd/render-bundle/resources/resources.go b/cmd/template2bundle/resources/resources.go similarity index 100% rename from cmd/render-bundle/resources/resources.go rename to cmd/template2bundle/resources/resources.go diff --git a/cmd/render-bundle/resources/usage.txt b/cmd/template2bundle/resources/usage.txt similarity index 100% rename from cmd/render-bundle/resources/usage.txt rename to cmd/template2bundle/resources/usage.txt