mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 20:20:39 +00:00
reverse the orderin
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
0927e34a03
commit
ff05dfd6dc
@ -248,8 +248,8 @@ func run(c *cli.Context) error {
|
|||||||
if c.Bool("tags.auto") {
|
if c.Bool("tags.auto") {
|
||||||
plugin.Build.Tags = docker.DefaultTagSuffix(
|
plugin.Build.Tags = docker.DefaultTagSuffix(
|
||||||
c.String("commit.ref"),
|
c.String("commit.ref"),
|
||||||
c.String("tags.suffix"),
|
|
||||||
c.String("repo.branch"),
|
c.String("repo.branch"),
|
||||||
|
c.String("tags.suffix"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
tags.go
2
tags.go
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
// DefaultTagSuffix returns a set of default suggested tags
|
// DefaultTagSuffix returns a set of default suggested tags
|
||||||
// based on the commit ref with an attached suffix.
|
// based on the commit ref with an attached suffix.
|
||||||
func DefaultTagSuffix(ref, suffix, defaultBranch string) []string {
|
func DefaultTagSuffix(ref, defaultBranch, suffix string) []string {
|
||||||
tags := DefaultTags(ref, defaultBranch)
|
tags := DefaultTags(ref, defaultBranch)
|
||||||
if len(suffix) == 0 {
|
if len(suffix) == 0 {
|
||||||
return tags
|
return tags
|
||||||
|
@ -109,7 +109,7 @@ func TestDefaultTagSuffix(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
got, want := DefaultTagSuffix(test.Before, test.Suffix, test.DefaultBranch), test.After
|
got, want := DefaultTagSuffix(test.Before, test.DefaultBranch, test.Suffix), test.After
|
||||||
if !reflect.DeepEqual(got, want) {
|
if !reflect.DeepEqual(got, want) {
|
||||||
t.Errorf("Got tag %v, want %v", got, want)
|
t.Errorf("Got tag %v, want %v", got, want)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user