From ff05dfd6dcc3f8a4276b607c0e3f7c6c15f624e5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 9 Nov 2017 10:55:44 +0800 Subject: [PATCH] reverse the orderin Signed-off-by: Bo-Yi Wu --- cmd/drone-docker/main.go | 2 +- tags.go | 2 +- tags_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/drone-docker/main.go b/cmd/drone-docker/main.go index a142cc4..b993bb9 100644 --- a/cmd/drone-docker/main.go +++ b/cmd/drone-docker/main.go @@ -248,8 +248,8 @@ func run(c *cli.Context) error { if c.Bool("tags.auto") { plugin.Build.Tags = docker.DefaultTagSuffix( c.String("commit.ref"), - c.String("tags.suffix"), c.String("repo.branch"), + c.String("tags.suffix"), ) } diff --git a/tags.go b/tags.go index d83821a..5f33e95 100644 --- a/tags.go +++ b/tags.go @@ -9,7 +9,7 @@ import ( // DefaultTagSuffix returns a set of default suggested tags // 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) if len(suffix) == 0 { return tags diff --git a/tags_test.go b/tags_test.go index 30732a5..709b6ba 100644 --- a/tags_test.go +++ b/tags_test.go @@ -109,7 +109,7 @@ func TestDefaultTagSuffix(t *testing.T) { } 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) { t.Errorf("Got tag %v, want %v", got, want) }