Fetches and generates template files from a specified URL using Cue configuration parameters.
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| url | string | Relative path or absolute URL pointing to the directory tree to fetch | |
| cueCmd | string | Cue command name | |
| cuePkg | string | Cue package name | |
| values | object | Values to pass on to the templating engine | |
| cueOutDir | string | Cue output dir | |
| targetPath | string | Target path within the working directory to generate contents to. Defaults to the working directory root. |
Output Schema
Usage Examples
Generate a Node.js service from a local Cue template
Generates a Node.js service scaffold from a template directory checked into the same repository. Use when your templates are versioned alongside your Backstage templates.
steps:
- id: cue-generate-service
action: cue:cueflow
input:
url: ./templates/node-service
values:
name: ${{ parameters.componentId }}
owner: ${{ parameters.owner }}
port: 8080
image: ghcr.io/acme/${{ parameters.componentId }}:0.1.0
env:
NODE_ENV: production
LOG_LEVEL: info
targetPath: services/${{ parameters.componentId }}Generate Kubernetes manifests from a remote template repo
Fetches a Cue-based Kubernetes template from a remote Git repository and renders manifests into an environment-specific folder. Use when you want reproducible deployments per environment.
steps:
- id: cue-generate-k8s
action: cue:cueflow
input:
url: https://github.com/acme/cueflow-templates/k8s?ref=v1.3.0
cuePkg: charts
cueCmd: run
cueOutDir: manifests
values:
app: ${{ parameters.componentId }}
image: ghcr.io/acme/${{ parameters.componentId }}:${{ parameters.version }}
replicas: 3
namespace: ${{ parameters.environment }}
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
targetPath: deploy/${{ parameters.environment }}/${{ parameters.componentId }}Minimal usage with defaults
Fetches a template using only the required URL and relies on default Cue package, command, and output directory. Use when the template encodes sensible defaults and does not require extra values.
steps:
- id: cue-generate-minimal
action: cue:cueflow
input:
url: https://example.com/templates/static-contentExport JSON configuration into a docs directory
Runs Cue export to materialize a JSON API configuration into a docs folder. Use when you want to publish machine-readable configuration as part of your repository documentation.
steps:
- id: cue-export-config
action: cue:cueflow
input:
url: ./templates/api-config
cuePkg: docs
cueCmd: export
cueOutDir: api
values:
service:
id: ${{ parameters.componentId }}
owner: ${{ parameters.owner }}
endpoints:
- path: /healthz
method: GET
- path: /v1/items
method: POST
version: ${{ parameters.version }}
targetPath: docsGenerate a monorepo workspace with multiple packages
Produces files for a monorepo layout by passing an array of packages to the Cue template. Use when bootstrapping multiple modules in a single repository.
steps:
- id: cue-generate-monorepo
action: cue:cueflow
input:
url: ./templates/monorepo
cuePkg: workspace
cueCmd: run
cueOutDir: out
values:
workspace: ${{ parameters.repoName }}
owner: ${{ parameters.owner }}
packages:
- name: api
language: go
port: 7007
- name: web
language: react
port: 3000
- name: worker
language: python
queue: orders
targetPath: packages