mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
feat: added Commit to docker name_template
This commit is contained in:
parent
438e6e210a
commit
ad118b0f7c
@ -53,9 +53,14 @@ dockers:
|
||||
skip_push: false
|
||||
# Path to the Dockerfile (from the project root).
|
||||
dockerfile: Dockerfile
|
||||
# Template of the docker tag. Defaults to `{{ .Version }}`. Other allowed
|
||||
# fields are `.Tag`, `.Major`, `.Minor` and `.Patch` and
|
||||
# `.Env.VARIABLE_NAME`.
|
||||
# Template of the docker tag. Defaults to `{{ .Version }}`.
|
||||
# Other allowed fields are:
|
||||
# - `.Commint`
|
||||
# - `.Tag`
|
||||
# - `.Major`
|
||||
# - `.Minor`
|
||||
# - `.Patch`
|
||||
# - `.Env.VARIABLE_NAME`
|
||||
tag_templates:
|
||||
- "{{ .Tag }}"
|
||||
- "{{ .Tag }}-{{ .Env.GO_VERSION }}"
|
||||
|
@ -126,11 +126,16 @@ func tagName(ctx *context.Context, tagTemplate string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
data := struct {
|
||||
Version, Tag string
|
||||
Major, Minor, Patch int64
|
||||
Env map[string]string
|
||||
Version string
|
||||
Tag string
|
||||
Commit string
|
||||
Major int64
|
||||
Minor int64
|
||||
Patch int64
|
||||
Env map[string]string
|
||||
}{
|
||||
Version: ctx.Version,
|
||||
Commit: ctx.Git.Commit,
|
||||
Tag: ctx.Git.CurrentTag,
|
||||
Env: ctx.Env,
|
||||
Major: sv.Major(),
|
||||
|
@ -78,6 +78,7 @@ func TestRunPipe(t *testing.T) {
|
||||
"{{.Tag}}-{{.Env.FOO}}",
|
||||
"v{{.Major}}",
|
||||
"v{{.Major}}.{{.Minor}}",
|
||||
"commint-{{.Commit}}",
|
||||
"latest",
|
||||
},
|
||||
Files: []string{
|
||||
|
Loading…
Reference in New Issue
Block a user