Skip to content

Commit

Permalink
Modified checkout to handle new go module behavior.
Browse files Browse the repository at this point in the history
Added go.mod and go.sum
  • Loading branch information
Nik Ogura committed Nov 2, 2018
1 parent 96f0700 commit 838dcfc
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 5 deletions.
33 changes: 33 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module github.com/nikogura/gomason

require (
github.com/Bowery/prompt v0.0.0-20180817134258-8a1d5376df1c // indirect
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 // indirect
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce
github.com/inconshreveable/mousetrap v1.0.0
github.com/kardianos/govendor v1.0.9 // indirect
github.com/magiconair/properties v1.8.0
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747
github.com/mitchellh/gox v0.4.0 // indirect
github.com/mitchellh/iochan v1.0.0 // indirect
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675
github.com/pelletier/go-toml v1.2.0
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6
github.com/pkg/errors v0.0.0-20171216070316-e881fd58d78e
github.com/pmezard/go-difflib v1.0.0
github.com/spf13/afero v1.1.1
github.com/spf13/cast v1.2.0
github.com/spf13/cobra v0.0.0-20180124073143-f91529fc6092
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d
github.com/stretchr/testify v0.0.0-20171018052257-2aa2c176b9da
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe
golang.org/x/text v0.0.0-20180617084112-5cec4b58c438
golang.org/x/tools v0.0.0-20181102195655-c3ef14e64260 // indirect
gopkg.in/ini.v1 v1.32.0
gopkg.in/yaml.v2 v2.2.1
)
58 changes: 58 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
github.com/Bowery/prompt v0.0.0-20180817134258-8a1d5376df1c h1:fAMg70P5ydy1uiIj6CdA69h6nmQKbv18VlVOXhKNrcM=
github.com/Bowery/prompt v0.0.0-20180817134258-8a1d5376df1c/go.mod h1:4/6eNcqZ09BZ9wLK3tZOjBA1nDj+B0728nlX5YRlSmQ=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495 h1:6IyqGr3fnd0tM3YxipK27TUskaOVUjU2nG45yzwcQKY=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185 h1:3T8ZyTDp5QxTx3NU48JVb2u+75xc040fofcBaN+6jPA=
github.com/dchest/safefile v0.0.0-20151022103144-855e8d98f185/go.mod h1:cFRxtTwTOJkz2x3rQUNCYKWC93yP1VKjR8NUhqFxZNU=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 h1:JM174NTeGNJ2m/oLH3UOWOvWQQKd+BoL3hcSCUWFLt0=
github.com/google/shlex v0.0.0-20150127133951-6f45313302b9/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno=
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/kardianos/govendor v1.0.9 h1:WOH3FcVI9eOgnIZYg96iwUwrL4eOVx+aQ66oyX2R8Yc=
github.com/kardianos/govendor v1.0.9/go.mod h1:yvmR6q9ZZ7nSF5Wvh40v0wfP+3TwwL8zYQp+itoZSVM=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747 h1:eQox4Rh4ewJF+mqYPxCkmBAirRnPaHEB26UkNuPyjlk=
github.com/mitchellh/go-homedir v0.0.0-20161203194507-b8bc1bf76747/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675 h1:/rdJjIiKG5rRdwG5yxHmSE/7ZREjpyC0kL7GxGT/qJw=
github.com/mitchellh/mapstructure v0.0.0-20180511142126-bb74f1db0675/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6 h1:2bae6N0SZjgzk+Zg8mzTsfmpwHXY9VBNp9UdjhaElA0=
github.com/phayes/freeport v0.0.0-20171002185219-e27662a4a9d6/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
github.com/pkg/errors v0.0.0-20171216070316-e881fd58d78e h1:+RHxT/gm0O3UF7nLJbdNzAmULvCFt4XfXHWzh3XI/zs=
github.com/pkg/errors v0.0.0-20171216070316-e881fd58d78e/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/spf13/afero v1.1.1 h1:Lt3ihYMlE+lreX1GS4Qw4ZsNpYQLxIXKBTEOXm3nt6I=
github.com/spf13/afero v1.1.1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg=
github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
github.com/spf13/cobra v0.0.0-20180124073143-f91529fc6092 h1:2o/E9K8mQZ1wijQfwvG9Q8OXe5HtBOuLfXmvG98JbEI=
github.com/spf13/cobra v0.0.0-20180124073143-f91529fc6092/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig=
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2 h1:OAuq3yHhRwcm/kwCSAqf07pUm/EcLZYNz1ket+Bm0SI=
github.com/spf13/pflag v0.0.0-20180601132542-3ebe029320b2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d h1:pIz+bbPLk78K39d3u77IlNpJvpS/f0ao8n3sdy82eCs=
github.com/spf13/viper v0.0.0-20180507071007-15738813a09d/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
github.com/stretchr/testify v0.0.0-20171018052257-2aa2c176b9da h1:/GRWXYJLcWpnjmFCtD64tuNT1YteX36zELue/SXxl5Y=
github.com/stretchr/testify v0.0.0-20171018052257-2aa2c176b9da/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe h1:ay7inWg28/GEO1erz2KR0ywSgsw4yPHUw1egz2vGcN0=
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.0.0-20180617084112-5cec4b58c438 h1:Evl03DW9QA/Q6b0oGwvf5H8aSAL/xt4LweM7hwikMWM=
golang.org/x/text v0.0.0-20180617084112-5cec4b58c438/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20181102195655-c3ef14e64260 h1:NbLlvM2BUcXomGwOrmTNZMJ7i3AUSkySbANUrSSfL4U=
golang.org/x/tools v0.0.0-20181102195655-c3ef14e64260/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.32.0 h1:9yR997mcSrhXxgxItwowxJCmCTrSSlnSN8FEbuXHFP0=
gopkg.in/ini.v1 v1.32.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.4.0",
"version": "2.4.1",
"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",
Expand Down
2 changes: 1 addition & 1 deletion pkg/gomason/building_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestBuild(t *testing.T) {
}

if _, err := os.Stat(fmt.Sprintf("%s/go/bin/govendor", tmpDir)); os.IsNotExist(err) {
log.Printf("Govendor vailed to install.")
log.Printf("Govendor failed to install.")
t.Fail()
}

Expand Down
12 changes: 11 additions & 1 deletion pkg/gomason/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import (
// Checkout Actually checks out the code you're trying to test into your temporary GOPATH
func Checkout(gopath string, meta Metadata, branch string, verbose bool) (err error) {

err = os.Chdir(gopath)
if err != nil {
err = errors.Wrapf(err, "failed to cwd to %s", gopath)
return err
}

// install the code via go get after all, we don't really want to play if it's not in a repo.
gocommand, err := exec.LookPath("go")
if err != nil {
Expand All @@ -19,6 +25,7 @@ func Checkout(gopath string, meta Metadata, branch string, verbose bool) (err er
}

runenv := append(os.Environ(), fmt.Sprintf("GOPATH=%s", gopath))
//runenv = append(runenv, "GO111MODULE=on")

var cmd *exec.Cmd

Expand All @@ -30,11 +37,14 @@ func Checkout(gopath string, meta Metadata, branch string, verbose bool) (err er
}

if verbose {
log.Printf("Running %s", cmd.Args)
log.Printf("Running %s with GOPATH=%s", cmd.Args, gopath)
}

cmd.Env = runenv

cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr

err = cmd.Run()

if err == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/gomason/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestGovendorInstall(t *testing.T) {
}

if _, err := os.Stat(fmt.Sprintf("%s/go/bin/govendor", tmpDir)); os.IsNotExist(err) {
log.Printf("Govendor vailed to install.")
log.Printf("Govendor failed to install.")
t.Fail()
}

Expand All @@ -43,7 +43,7 @@ func TestGovendorSync(t *testing.T) {
}

if _, err := os.Stat(fmt.Sprintf("%s/go/bin/govendor", tmpDir)); os.IsNotExist(err) {
log.Printf("Govendor vailed to install.")
log.Printf("Govendor failed to install.")
t.Fail()
}

Expand Down

0 comments on commit 838dcfc

Please sign in to comment.