diff --git a/metadata.json b/metadata.json index 7014381..a08c2d2 100644 --- a/metadata.json +++ b/metadata.json @@ -1,5 +1,5 @@ { - "version": "2.12.1", + "version": "2.13.0", "package": "github.com/nikogura/gomason", "description": "A tool for testing, building, signing, and publishing your project from a clean workspace.", "repository": "http://localhost:8081/artifactory/generic-local", diff --git a/pkg/gomason/golang.go b/pkg/gomason/golang.go index 31e7daa..0469ef4 100644 --- a/pkg/gomason/golang.go +++ b/pkg/gomason/golang.go @@ -312,9 +312,11 @@ func (g Golang) Build(gopath string, meta Metadata, skipTargets string, local bo logrus.Debugf("LD Flag: %s", ldflags) } - outputTemplate := fmt.Sprintf("%s_{{.OS}}_{{.Arch}}", meta.Name) + // Interesting idea, but breaks multiple binary builds such as dbt. To properly implement, we'd have to find and handle each binary instead of relying on the './...'. + //outputTemplate := fmt.Sprintf("%s_{{.OS}}_{{.Arch}}", meta.Name) + //args := gox + cgo + ldflags + ` -osarch="` + target.Name + `"` + ` -output="` + outputTemplate + `"` + " ./..." - args := gox + cgo + ldflags + ` -osarch="` + target.Name + `"` + ` -output="` + outputTemplate + `"` + " ./..." + args := gox + cgo + ldflags + ` -osarch="` + target.Name + `"` + " ./..." logrus.Debugf("Running gox with: %s in dir %s", args, wd) diff --git a/pkg/gomason/golang_test.go b/pkg/gomason/golang_test.go index 386c22e..742b86f 100644 --- a/pkg/gomason/golang_test.go +++ b/pkg/gomason/golang_test.go @@ -91,7 +91,7 @@ func TestPrep(t *testing.T) { t.Errorf("Failed to checkout module") } - err = lang.Prep(gopath, testMetadataObj()) + err = lang.Prep(gopath, testMetadataObj(), false) if err != nil { t.Errorf("error running prep steps: %s", err) } @@ -167,12 +167,12 @@ func TestBuild(t *testing.T) { t.Errorf("Failed to checkout module") } - err = lang.Prep(gopath, testMetadataObj()) + err = lang.Prep(gopath, testMetadataObj(), false) if err != nil { t.Errorf("error running prep steps: %s", err) } - err = lang.Build(gopath, testMetadataObj(), tc.skipTargets) + err = lang.Build(gopath, testMetadataObj(), tc.skipTargets, false) if err != nil { t.Errorf("Error building: %s", err) } @@ -218,12 +218,12 @@ func TestTest(t *testing.T) { t.Errorf("Failed to checkout module") } - err = lang.Prep(gopath, testMetadataObj()) + err = lang.Prep(gopath, testMetadataObj(), false) if err != nil { t.Errorf("error running prep steps: %s", err) } - err = lang.Test(gopath, testMetadataObj().Package, "10m") + err = lang.Test(gopath, testMetadataObj().Package, "10m", false) if err != nil { t.Errorf("error running go test: %s", err) } @@ -259,7 +259,7 @@ func TestSignVerifyBinary(t *testing.T) { meta.Repository = fmt.Sprintf("http://localhost:%d/repo/tool", servicePort) // build artifacts - err = lang.Build(gopath, meta, "") + err = lang.Build(gopath, meta, "", false) if err != nil { t.Errorf("Error building: %s", err) } @@ -338,12 +338,12 @@ Expire-Date: 0 t.Errorf("Failed to get current working directory: %s", err) } - err = g.HandleArtifacts(meta, gopath, cwd, false, true, true, "") + err = g.HandleArtifacts(meta, gopath, cwd, false, true, true, "", false) if err != nil { t.Errorf("post-build processing failed: %s", err) } - err = g.HandleExtras(meta, gopath, cwd, false, true, true) + err = g.HandleExtras(meta, gopath, cwd, false, true, true, false) if err != nil { t.Errorf("Extra artifact processing failed: %s", err) } diff --git a/pkg/gomason/gomason.go b/pkg/gomason/gomason.go index a039953..4eb659e 100644 --- a/pkg/gomason/gomason.go +++ b/pkg/gomason/gomason.go @@ -19,7 +19,7 @@ func init() { } // VERSION is the current gomason version -const VERSION = "2.12.1" +const VERSION = "2.13.0" // METADATA_FILENAME The default gomason metadata file name const METADATA_FILENAME = "metadata.json" diff --git a/pkg/gomason/languages_test.go b/pkg/gomason/languages_test.go index 83a28e5..17e6c99 100644 --- a/pkg/gomason/languages_test.go +++ b/pkg/gomason/languages_test.go @@ -15,13 +15,13 @@ func TestNoLanguage(t *testing.T) { err = nl.Checkout("", Metadata{}, "") assert.True(t, err == nil, "Checkout returned an error") - err = nl.Prep("", Metadata{}) + err = nl.Prep("", Metadata{}, false) assert.True(t, err == nil, "Prep returned an error") - err = nl.Test("", "", "") + err = nl.Test("", "", "", false) assert.True(t, err == nil, "Test returned an error") - err = nl.Build("", Metadata{}, "") + err = nl.Build("", Metadata{}, "", false) assert.True(t, err == nil, "Build returned an error") }