helmfile/cmd
yxxhero ee65b88edf feat: support .Environment.* in --output-dir-template
This commit adds support for accessing environment values in the --output-dir-template flag.

Previously, users could only access .OutputDir, .State.*, and .Release.* in the template.
Now .Environment.* is also available, allowing users to use environment values in the
output directory path.

Example usage:
  helmfile template -e test-1 --output-dir-template='{{ .OutputDir }}/{{ .Environment.cluster.name }}/{{ .Environment.Name }}/{{ .Release.Name }}'

This produces output like: ./gitops/my-test-cluster/test-1/release-name/

Changes:
- Add Environment field to GenerateOutputDir template data
- Add Environment field to generateChartPath template data (now a method on HelmState)
- Update help text for --output-dir-template flag in template and fetch commands
- Add test cases for Environment in template

Signed-off-by: yxxhero <aiopsclub@163.com>
2026-01-23 08:51:32 +08:00
..
apply.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
build.go Optimize cmd pkg (#384) 2022-10-05 11:02:24 +09:00
cache.go Merge branch 'main' into update_golang_lint 2022-08-14 12:21:10 +09:00
deps.go fix --debug flag 2022-10-25 08:24:23 +08:00
destroy.go Create DeleteWait and DeleteTimeout parameters for Destroy (#1177) 2023-12-05 08:38:37 +08:00
diff.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
fetch.go feat: support .Environment.* in --output-dir-template 2026-01-23 08:51:32 +08:00
init.go Add subcommand init for checks and installs helmfile deps (#389) 2022-11-03 14:51:30 +08:00
lint.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00
list.go Optimize cmd pkg (#384) 2022-10-05 11:02:24 +09:00
print_env.go feat: add print-env command (#2279) 2025-11-28 08:46:37 +08:00
repos.go fix: repos command help message (#698) 2023-02-15 07:23:50 +08:00
root.go Add --sequential-helmfiles flag for optional sequential processing (#2350) 2026-01-08 14:28:25 -05:00
show-dag.go Update DAG with dependencies (#1477) 2024-04-27 07:37:28 +08:00
status.go fix --debug flag 2022-10-25 08:24:23 +08:00
sync.go Issue-1883 fix (#2058) 2025-11-19 07:45:56 +08:00
template.go feat: support .Environment.* in --output-dir-template 2026-01-23 08:51:32 +08:00
test.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00
write-values.go feat: add/expose cli flags (#771) 2023-04-02 14:53:52 +08:00