1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

docs: add docs for env vars in name_template

Add docs for using env vars in name_template.
This commit is contained in:
Frank Schroeder 2017-12-07 23:21:36 +01:00 committed by Carlos Alexandro Becker
parent 904d4455f4
commit 5a199e50d2

View File

@ -20,6 +20,7 @@ archive:
# - Os
# - Arch
# - Arm (ARM version)
# - Env (environment variables)
# Default is `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`.
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
@ -63,3 +64,19 @@ archive:
- docs/*
- design/*.png
```
## Passing environment variables to name_template
You can do that by using `{{ .Env.VARIABLE_NAME }}` in the template, for
example:
```yaml
archive:
name_template: '{{.ProjectName}}-{{.Version}}-{{.Env.GOVERSION_NR}}'
```
Then you can run:
```console
GOVERSION_NR=$(go version | awk '{print $3;}') goreleaser
```