From 51c38f2c3accfc9aaf4acb71d28a9e136aca0bfc Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:17:33 +0300 Subject: [PATCH 01/17] use sync/errgroup --- cli/cli.go | 44 ++++++++++++++++++++------------------------ go.mod | 1 + go.sum | 3 +++ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index b1896719..a4c52742 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -13,12 +13,13 @@ import ( "runtime" "runtime/pprof" "strings" - "sync" "github.com/docker/docker/client" "github.com/komuw/meli" "github.com/pkg/errors" yaml "gopkg.in/yaml.v2" + + "golang.org/x/sync/errgroup" ) /* DOCS: @@ -163,10 +164,8 @@ func main() { } } - var wg sync.WaitGroup + var eg errgroup.Group for k, v := range dockerCyaml.Services { - wg.Add(1) - // use dotted filepath. make it also work for windows r := strings.NewReplacer("/", ".", ":", ".", "\\", ".") dotFormattedrCurentDir := r.Replace(curentDir) @@ -183,9 +182,16 @@ func main() { CurentDir: dotFormattedrCurentDir, Rebuild: rebuild, EnvFile: v.EnvFile} - go startComposeServices(ctx, cli, &wg, dc) + + eg.Go(func() error { + err := startComposeServices(ctx, cli, dc) + return err + }) + } + err = eg.Wait() + if err != nil { + log.Fatalf("\n\t %+v", err) } - wg.Wait() if memprofile != "" { f, err := os.Create(memprofile) @@ -202,9 +208,7 @@ func main() { } } -func startComposeServices(ctx context.Context, cli *client.Client, wg *sync.WaitGroup, dc *meli.DockerContainer) { - defer wg.Done() - +func startComposeServices(ctx context.Context, cli *client.Client, dc *meli.DockerContainer) error { /* 1. Pull Image 2. Create a container @@ -216,40 +220,32 @@ func startComposeServices(ctx context.Context, cli *client.Client, wg *sync.Wait if len(dc.ComposeService.Image) > 0 { err := meli.PullDockerImage(ctx, cli, dc) if err != nil { - // clean exit since we want other goroutines for fetching other images - // to continue running - fmt.Printf("\n\n%+v", err) - return + return err } } alreadyCreated, _, err := meli.CreateContainer(ctx, cli, dc) if err != nil { - // clean exit since we want other goroutines for fetching other images - // to continue running - fmt.Printf("\n\n%+v", err) - return + return err } if !alreadyCreated { err = meli.ConnectNetwork(ctx, cli, dc) if err != nil { - // create whitespace so that error is visible to human - fmt.Printf("\n\n%+v", err) - return + return err } } err = meli.ContainerStart(ctx, cli, dc) if err != nil { - fmt.Printf("\n\n%+v", err) - return + return err } err = meli.ContainerLogs(ctx, cli, dc) if err != nil { - fmt.Printf("\n\n%+v", err) - return + return err } + + return nil } func getCwdName(path string) string { diff --git a/go.mod b/go.mod index 5d12f5ca..3851dbd6 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/sirupsen/logrus v1.4.2 // indirect github.com/stretchr/testify v1.3.0 // indirect golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect + golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601 // indirect diff --git a/go.sum b/go.sum index 67b2d6fd..16e03f6a 100644 --- a/go.sum +++ b/go.sum @@ -74,7 +74,10 @@ golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 h1:FP8hkuE6yUEaJnK7O2eTuejKW golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 274ee33fe9de97f2bfd27790eaefd1090132f65a Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:33:01 +0300 Subject: [PATCH 02/17] static --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f9ddb15..e2c66c67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ jobs: wget -nc --directory-prefix=/tmp https://github.com/myitcv/gobin/releases/download/$GOBIN_VERSION/linux-amd64 mv /tmp/linux-amd64 /usr/local/bin/gobin chmod +x /usr/local/bin/gobin - gobin honnef.co/go/tools/cmd/staticcheck@2019.1 + gobin honnef.co/go/tools/cmd/staticcheck@2019.2.2 - run: name: Install Docker client @@ -136,7 +136,7 @@ jobs: command: source /etc/profile && go vet -v -all -shadow ./... - run: name: staticcheck - command: source /etc/profile && staticcheck -tests -show-ignored ./... + command: source /etc/profile && staticcheck -tests -show-ignored -go 1.13 -unused.whole-program ./... - run: name: run tests command: source /etc/profile && go test -timeout 1m -race -cover -v ./... From b6ac926c3f6c07162c72ef36d68e4137d4004640 Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:39:28 +0300 Subject: [PATCH 03/17] m --- go.mod | 9 +++++---- go.sum | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 3851dbd6..930ee5de 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ require ( github.com/Microsoft/go-winio v0.4.12 // indirect github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v0.7.3-0.20181221150755-2cb26cfe9cbf - github.com/docker/docker-credential-helpers v0.6.2 + github.com/docker/docker-credential-helpers v0.6.3 github.com/docker/go-connections v0.4.0 github.com/docker/go-units v0.4.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect @@ -21,10 +21,11 @@ require ( github.com/stretchr/testify v1.3.0 // indirect golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect + golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect - google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601 // indirect - google.golang.org/grpc v1.21.1 // indirect + google.golang.org/appengine v1.4.0 // indirect + google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect + google.golang.org/grpc v1.22.1 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v2 v2.2.2 gotest.tools v2.2.0+incompatible // indirect diff --git a/go.sum b/go.sum index 16e03f6a..bba4ea57 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker-credential-helpers v0.6.2 h1:CrW9H1VMf3a4GrtyAi7IUJjkJVpwBBpX0+mvkvYJaus= -github.com/docker/docker-credential-helpers v0.6.2/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= +github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/engine v0.0.0-20190618213011-b07f53d0a4e7 h1:v8cqbUr9o2JRb+4rIDWPmncYtTLuXZZprbD7ggflCU8= github.com/docker/engine v0.0.0-20190618213011-b07f53d0a4e7/go.mod h1:3CPr2caMgTHxxIAZgEMd3uLYPDlRvPqCpyeRf6ncPcY= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -25,8 +25,8 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -81,8 +81,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= +golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -90,15 +90,16 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601 h1:9VBRTdmgQxbs6HE0sUnMrSWNePppAJU07NYvX5dIB04= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -107,3 +108,4 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 890116d4c63fc313f70251769f104c4f85ba9f2d Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:42:15 +0300 Subject: [PATCH 04/17] update docker --- go.mod | 5 ++--- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 930ee5de..eff07b25 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,6 @@ require ( golang.org/x/sync v0.0.0-20190423024810-112230192c58 golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect - google.golang.org/appengine v1.4.0 // indirect google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect google.golang.org/grpc v1.22.1 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect @@ -33,7 +32,7 @@ require ( // look at: https://github.com/golang/go/issues/29376#issuecomment-449416502 -// github.com/docker/engine v19.03.0-rc3 -replace github.com/docker/docker => github.com/docker/engine v0.0.0-20190618213011-b07f53d0a4e7 +// github.com/docker/engin v19.03.1 +replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190725163905-fa8dd90ceb7b go 1.13 diff --git a/go.sum b/go.sum index bba4ea57..7e2cfa9b 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BU github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/engine v0.0.0-20190618213011-b07f53d0a4e7 h1:v8cqbUr9o2JRb+4rIDWPmncYtTLuXZZprbD7ggflCU8= -github.com/docker/engine v0.0.0-20190618213011-b07f53d0a4e7/go.mod h1:3CPr2caMgTHxxIAZgEMd3uLYPDlRvPqCpyeRf6ncPcY= +github.com/docker/engine v1.4.2-0.20190725163905-fa8dd90ceb7b h1:SOVm5RGfG5WeMWYaxaSQ6I8W2GN+H27ySGVhx7+HsQo= +github.com/docker/engine v1.4.2-0.20190725163905-fa8dd90ceb7b/go.mod h1:3CPr2caMgTHxxIAZgEMd3uLYPDlRvPqCpyeRf6ncPcY= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= From 708a66523f76cde7ab33aba2e0ce989fdc653520 Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:43:39 +0300 Subject: [PATCH 05/17] update docker --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index eff07b25..0d03bdd1 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( // look at: https://github.com/golang/go/issues/29376#issuecomment-449416502 -// github.com/docker/engin v19.03.1 +// github.com/docker/engine v19.03.1 replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190725163905-fa8dd90ceb7b go 1.13 From 656f7fcf6035a40be5ebe56d57ea84a785b7148e Mon Sep 17 00:00:00 2001 From: komuW Date: Thu, 8 Aug 2019 15:50:10 +0300 Subject: [PATCH 06/17] update yaml sdk --- cli/cli.go | 2 +- go.mod | 3 ++- go.sum | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index a4c52742..c36d7c6e 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -17,7 +17,7 @@ import ( "github.com/docker/docker/client" "github.com/komuw/meli" "github.com/pkg/errors" - yaml "gopkg.in/yaml.v2" + yaml "gopkg.in/yaml.v3" "golang.org/x/sync/errgroup" ) diff --git a/go.mod b/go.mod index 0d03bdd1..af1f0f7c 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,8 @@ require ( google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect google.golang.org/grpc v1.22.1 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect - gopkg.in/yaml.v2 v2.2.2 + // TODO: tag with a proper version after https://github.com/go-yaml/yaml/issues/487 is fixed + gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 gotest.tools v2.2.0+incompatible // indirect ) diff --git a/go.sum b/go.sum index 7e2cfa9b..b6435302 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 h1:0efs3hwEZhFKsCoP8l6dDB1AZWMgnEl3yWXWRZTOaEA= +gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From da6e86b924fc4a33bb476cf46d78f1c547f29cc3 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 12:40:51 +0300 Subject: [PATCH 07/17] m --- go.mod | 24 ++++++++------------ go.sum | 69 +++++++++++++++++++--------------------------------------- 2 files changed, 31 insertions(+), 62 deletions(-) diff --git a/go.mod b/go.mod index af1f0f7c..b793659f 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,27 @@ module github.com/komuw/meli +go 1.13 + require ( github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 // indirect - github.com/Microsoft/go-winio v0.4.12 // indirect + github.com/Microsoft/go-winio v0.4.14 // indirect github.com/docker/distribution v2.7.1+incompatible // indirect - github.com/docker/docker v0.7.3-0.20181221150755-2cb26cfe9cbf + github.com/docker/docker v1.13.1 github.com/docker/docker-credential-helpers v0.6.3 github.com/docker/go-connections v0.4.0 github.com/docker/go-units v0.4.0 // indirect github.com/gogo/protobuf v1.2.1 // indirect - github.com/google/go-cmp v0.3.0 // indirect - github.com/gorilla/mux v1.7.1 // indirect - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect - github.com/kr/pretty v0.1.0 // indirect + github.com/google/go-cmp v0.3.1 // indirect + github.com/gorilla/mux v1.7.3 // indirect github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c // indirect github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/pkg/errors v0.8.1 - github.com/sirupsen/logrus v1.4.2 // indirect - github.com/stretchr/testify v1.3.0 // indirect - golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect + github.com/stretchr/testify v1.4.0 // indirect + golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 // indirect golang.org/x/sync v0.0.0-20190423024810-112230192c58 - golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect - google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect - google.golang.org/grpc v1.22.1 // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + google.golang.org/grpc v1.23.0 // indirect // TODO: tag with a proper version after https://github.com/go-yaml/yaml/issues/487 is fixed gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 gotest.tools v2.2.0+incompatible // indirect @@ -35,5 +31,3 @@ require ( // github.com/docker/engine v19.03.1 replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190725163905-fa8dd90ceb7b - -go 1.13 diff --git a/go.sum b/go.sum index b6435302..a249a425 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/Microsoft/go-winio v0.4.12 h1:xAfWHN1IrQ0NJ9TBC0KBZoqLjzDTr1ML+4MywiUOryc= -github.com/Microsoft/go-winio v0.4.12/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -25,24 +25,15 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU= -github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c h1:nXxl5PrvVm2L/wCy8dQu6DMTwH4oIuGN8GJDAlqDdVE= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= @@ -53,59 +44,43 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/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/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 h1:FP8hkuE6yUEaJnK7O2eTuejKWwW+Rhfj80dQ2JcKxCU= -golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 h1:iKtrH9Y8mcbADOP0YFaEMth7OfuHY9xHOwNj4znpM1A= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.22.1 h1:/7cs52RnTJmD43s3uxzlq2U7nqVTd/37viQwMrMNlOM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 h1:0efs3hwEZhFKsCoP8l6dDB1AZWMgnEl3yWXWRZTOaEA= gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From d2c759de2f624555fb02d9b9a4c0780e2c9fcb25 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 12:48:52 +0300 Subject: [PATCH 08/17] m --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2c66c67..be042458 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - run: name: install golang command: | - VER="go1.11" + VER="go1.12" wget --directory-prefix=/usr/local https://dl.google.com/go/$VER.linux-amd64.tar.gz tar -C /usr/local -xzf /usr/local/$VER.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin @@ -203,7 +203,7 @@ jobs: - run: name: install golang command: | - VER="go1.11" + VER="go1.12" wget --directory-prefix=/usr/local https://dl.google.com/go/$VER.linux-amd64.tar.gz tar -C /usr/local -xzf /usr/local/$VER.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin From 44d868f3b94125cf046a15fdd08f378370e0dcec Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 12:54:29 +0300 Subject: [PATCH 09/17] m --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index be042458..943efafc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.06.0-ce + version: 18.09.3 - run: name: install apt and pip deps command: | @@ -62,7 +62,7 @@ jobs: name: Install Docker client command: | set -x - DOCKER_VER="18.06.0-ce" + DOCKER_VER="18.09.3" curl -L -o /tmp/docker-$DOCKER_VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VER.tgz tar -xz -C /tmp -f /tmp/docker-$DOCKER_VER.tgz mv /tmp/docker/* /usr/bin From 9221aa0662be1d039158023974b254d0ef1f018c Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 13:43:36 +0300 Subject: [PATCH 10/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 943efafc..138dfddd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.09.3 + version: 19.03.1 - run: name: install apt and pip deps command: | From 65e62fb00fb221c985510f3fc32b0b35376e6db0 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 13:53:19 +0300 Subject: [PATCH 11/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 138dfddd..7141913c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 19.03.1 + version: 18.09.8 - run: name: install apt and pip deps command: | From 1e7aa29637c55e3eaaf2d67c64f77374088ae393 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 13:56:39 +0300 Subject: [PATCH 12/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7141913c..01f48523 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.09.8 + version: 18.09.6 - run: name: install apt and pip deps command: | From 7d13de3c5383777635cc1466c880c74d57e80371 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 15:02:59 +0300 Subject: [PATCH 13/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01f48523..40518060 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.09.6 + version: 18.09.3 - run: name: install apt and pip deps command: | From 2ab940ca0133c0fd830e5634d6b86c0b3e19815d Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 15:10:11 +0300 Subject: [PATCH 14/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40518060..1030a9b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.09.3 + version: 18.09.3-ce - run: name: install apt and pip deps command: | From 3c27c201b2f3dd8591dde82a2cba390a5c4fb440 Mon Sep 17 00:00:00 2001 From: komuw Date: Sun, 1 Sep 2019 15:12:18 +0300 Subject: [PATCH 15/17] m --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1030a9b7..40518060 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ jobs: - checkout # the docker version specified here should be same as the docker version of the client you install. - setup_remote_docker: - version: 18.09.3-ce + version: 18.09.3 - run: name: install apt and pip deps command: | From 57f59457d838ba0d9157250eff9bdb2b9567d4cb Mon Sep 17 00:00:00 2001 From: Komu Wairagu Date: Tue, 3 Sep 2019 01:19:33 +0300 Subject: [PATCH 16/17] Set up CI with Azure Pipelines (#125) * Set up CI with Azure Pipelines [skip ci] * m * m * m * m * m * m3 * m4 * m6 * m * m9 * m11 * m11 * m13 * m15 * m17 * m19 * m21 * later * g1 * g2 * d * sudo * sudo * s1 * s3 * s5 * s8 * m3 * s9 * s9 * s9 * s9 * s9 * s9 * m3 * m3 * m3 * m3 * m3 * m3 * m3 * Update azure-pipelines.yml * md * m3 * m6 * m6 * mdrrwr42 * mdrrwr42 --- .github/RELEASE_NOTES.md | 7 + azure-pipelines.yml | 303 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 310 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/.github/RELEASE_NOTES.md b/.github/RELEASE_NOTES.md index 7edd153f..8f3d7ce9 100644 --- a/.github/RELEASE_NOTES.md +++ b/.github/RELEASE_NOTES.md @@ -1,3 +1,10 @@ # Release Notes + + +## v0.2.2 +- change ci provider: https://github.com/komuw/meli/pull/125 +- use `sync/errgroup`: https://github.com/komuw/meli/pull/124 + + ## v0.2.1 - Fix a bug where a build (for a service that has supplied a custom context and dockerFile) would fail: https://github.com/komuw/meli/pull/120 diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..ada67fd9 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,303 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# for reference see: https://aka.ms/yaml + +# Each step runs in its own process on an agent and has access to the pipeline workspace on disk. +# This means environment variables are not preserved between steps but filesystem changes are. +# NB: do not use double quotes in this file unless it is impossible. +# prefer single quotes. for some reason azure fails with double quotes + +variables: # pipeline-level + system.debug: true + GOLANG_VERSION: 'go1.12' + DOCKER_VERSION: '18.09.6' + GORELEASER_VERSION: 'v0.117.1' + GOBIN_VERSION: 'v0.0.11' + + +jobs: + + - job: build + # workingDirectory: '~/stuff/notgopath/meli' + timeoutInMinutes: 5 + pool: + vmImage: 'ubuntu-16.04' + steps: + - bash: | + pwd; ls -lsha + sudo apt-get -y update + sudo apt -y install \ + curl \ + wget \ + git \ + python \ + python-pip \ + software-properties-common \ + build-essential \ + snapd \ + snapcraft \ + nano \ + apt-transport-https \ + ca-certificates + # pip install -U pip # see; https://github.com/pypa/pip/issues/5221 + pip install -U docker-compose + displayName: install apt and pip deps + env: + someEnvVarName: someEnvVarValue + + - bash: | + ChangedFiles=`git diff --name-only origin/master` + echo $ChangedFiles + case "$ChangedFiles" in + *RELEASE_NOTES.*) + printf '\n Thanks, your commits include update to release notes. \n';; + *) + printf '\n You should add release notes to .github/RELEASE_NOTES.md \n' && exit 77;; + esac + displayName: check if changes have release notes + condition: ne(variables['Build.SourceBranch'], 'refs/heads/master') + + - bash: | + wget --directory-prefix=/usr/local https://dl.google.com/go/$(GOLANG_VERSION).linux-amd64.tar.gz + tar -C /usr/local -xzf /usr/local/$(GOLANG_VERSION).linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile + mkdir -p ~/go/bin + echo 'export PATH=$PATH:~/go/bin' >> /etc/profile + echo 'export LC_ALL=C.UTF-8' >> /etc/profile + echo 'export LANG=C.UTF-8' >> /etc/profile + echo 'export GO111MODULE=on' >> /etc/profile + source /etc/profile + displayName: install golang + + - bash: | + curl -L -o /tmp/docker-$DOCKER_VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VER.tgz + tar -xz -C /tmp -f /tmp/docker-$DOCKER_VER.tgz + mv /tmp/docker/* /usr/bin + docker version + displayName: Install Docker + + - bash: | + docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af + source /etc/profile && go build --race -o meli cli/cli.go + ./meli -v + ./meli -up -d -f testdata/docker-compose.yml + num_containers=$(docker ps -q | wc -l) + echo "number of containers are; $num_containers" + if [ "$num_containers" != "12" ]; then + echo "wanted 12 containers, got $num_containers" && exit 500 + fi + displayName: run meli + + - bash: | + docker exec backup ping -w3 redis + displayName: check that docker linking works I + + # TODO: this works locally but not in azure pipelines + # - bash: | + # docker exec backup ping -w3 eminem.com + # displayName: check that docker linking works II + + - bash: | + CHECK_ENV_VAR=$(docker exec -it buildservice printenv | grep NAME_IN_ENV_FILE) + echo 'env var from .env file is; $CHECK_ENV_VAR' + if [[ $CHECK_ENV_VAR != *'Mutabaruka'* ]]; then + echo 'wanted env var NAME_IN_ENV_FILE=Mutabaruka, got $CHECK_ENV_VAR' + fi + displayName: check that docker .env file works + + - bash: | + docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af + cp meli testdata/ && cd testdata/ && ./meli -up -d + num_containers=$(docker ps -q | wc -l) + echo "number of containers are; $num_containers" + if [ "$num_containers" != "12" ]; then + echo "wanted 12 containers, got $num_containers" && exit 500 + fi + displayName: run meli in testdata + + # test rebuild, stop (BUT DO NOT remove) containers from previous command + - bash: | + docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af + ./meli -up -d -f testdata/docker-compose.yml -build + all_containers=$(docker ps -aq | wc -l) + running_containers=$(docker ps -q | wc -l) + echo "number of all containers; $all_containers" + echo "number of running containers are; $running_containers" + if [ "$running_containers" != "12" ]; then + echo "wanted 12 containers, got $running_containers" && exit 500 + fi + displayName: test rebuild + + - job: tests_and_analysis + timeoutInMinutes: 3 + pool: + vmImage: 'ubuntu-16.04' + steps: + - bash: | + pwd; ls -lsha + sudo apt-get -y update + sudo apt -y install \ + curl \ + wget \ + git \ + apt-transport-https \ + ca-certificates + displayName: install apt deps + + - bash: | + wget --directory-prefix=/usr/local https://dl.google.com/go/$(GOLANG_VERSION).linux-amd64.tar.gz + tar -C /usr/local -xzf /usr/local/$(GOLANG_VERSION).linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile + mkdir -p ~/go/bin + echo 'export PATH=$PATH:~/go/bin' >> /etc/profile + echo 'export LC_ALL=C.UTF-8' >> /etc/profile + echo 'export LANG=C.UTF-8' >> /etc/profile + echo 'export GO111MODULE=on' >> /etc/profile + source /etc/profile + displayName: install golang + + - bash: | + source /etc/profile + wget -nc --directory-prefix=/tmp https://github.com/myitcv/gobin/releases/download/$GOBIN_VERSION/linux-amd64 + mv /tmp/linux-amd64 /tmp/gobin + chmod +x /tmp/gobin + /tmp/gobin honnef.co/go/tools/cmd/staticcheck@2019.2.2 + displayName: install tools + env: + GOBIN: /tmp + + - bash: | + source /etc/profile && go vet -v -all ./... + source /etc/profile && /tmp/staticcheck -tests -show-ignored -go 1.13 -unused.whole-program ./... + displayName: static analysis + + - bash: | + source /etc/profile && go test -timeout 1m -race -cover -v ./... + source /etc/profile && go test -timeout 1m -race -run=XXXX -bench=. ./... + displayName: tests and benchmarks + + - bash: | + source /etc/profile && \ + go test -timeout 1m -v -race -cover -coverprofile=coverage.txt ./... && \ + bash <(curl -s https://codecov.io/bash) + displayName: codecov + + - job: benchmarks_against_docker_compose + timeoutInMinutes: 5 + pool: + vmImage: 'ubuntu-16.04' + steps: + - bash: | + pwd; ls -lsha + sudo apt-get -y update + sudo apt -y install \ + curl \ + wget \ + git \ + python \ + python-pip \ + software-properties-common \ + build-essential \ + snapd \ + snapcraft \ + nano \ + apt-transport-https \ + ca-certificates + # pip install -U pip # see; https://github.com/pypa/pip/issues/5221 + pip install -U docker-compose + displayName: install apt and pip deps + + - bash: | + wget --directory-prefix=/usr/local https://dl.google.com/go/$(GOLANG_VERSION).linux-amd64.tar.gz + tar -C /usr/local -xzf /usr/local/$(GOLANG_VERSION).linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile + mkdir -p ~/go/bin + echo 'export PATH=$PATH:~/go/bin' >> /etc/profile + echo 'export LC_ALL=C.UTF-8' >> /etc/profile + echo 'export LANG=C.UTF-8' >> /etc/profile + echo 'export GO111MODULE=on' >> /etc/profile + source /etc/profile + displayName: install golang + + - bash: | + curl -L -o /tmp/docker-$DOCKER_VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VER.tgz + tar -xz -C /tmp -f /tmp/docker-$DOCKER_VER.tgz + mv /tmp/docker/* /usr/bin + docker version + displayName: Install Docker + + - bash: | + rm meli + source /etc/profile && go build -o meli cli/cli.go + docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af + docker-compose version + time docker-compose -f testdata/docker-compose.yml up -d + displayName: time docker-compose up + + - bash: | + docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af + time ./meli -up -d -f testdata/docker-compose.yml + displayName: time meli -up + + - job: deploy + dependsOn: + - build + - tests_and_analysis + - benchmarks_against_docker_compose + condition: eq(variables['Build.SourceBranch'], 'refs/heads/master') + timeoutInMinutes: 3 + pool: + vmImage: 'ubuntu-16.04' + steps: + - bash: | + pwd; ls -lsha + sudo apt-get -y update + sudo apt -y install \ + curl \ + wget \ + git \ + python \ + python-pip \ + software-properties-common \ + build-essential \ + snapd \ + snapcraft \ + nano \ + apt-transport-https \ + ca-certificates + # pip install -U pip # see; https://github.com/pypa/pip/issues/5221 + pip install -U docker-compose + displayName: install apt and pip deps + + - bash: | + wget --directory-prefix=/usr/local https://dl.google.com/go/$(GOLANG_VERSION).linux-amd64.tar.gz + tar -C /usr/local -xzf /usr/local/$(GOLANG_VERSION).linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile + mkdir -p ~/go/bin + echo 'export PATH=$PATH:~/go/bin' >> /etc/profile + echo 'export LC_ALL=C.UTF-8' >> /etc/profile + echo 'export LANG=C.UTF-8' >> /etc/profile + echo 'export GO111MODULE=on' >> /etc/profile + source /etc/profile + displayName: install golang + + - bash: | + wget --directory-prefix=/usr/local https://github.com/goreleaser/goreleaser/releases/download/$GORELEASER_VERSION/goreleaser_Linux_x86_64.tar.gz + tar -C /usr/local -xzf /usr/local/goreleaser_Linux_x86_64.tar.gz + displayName: install go releaser + + - bash: | + LAST_GIT_MESSAGE=$(git log -n1 --format=oneline --pretty=%B) + echo 'last git commit message on master:' + echo $LAST_GIT_MESSAGE + if [ '$LAST_GIT_MESSAGE' == 'do release' ]; then + echo 'deploying with goreleaser' + source /etc/profile + /usr/local/goreleaser --rm-dist --config=.goreleaser.yml --debug --skip-validate --release-notes=.github/RELEASE_NOTES.md + fi + displayName: do new release From a157e355e01b9116795476db1a9ce305e830f83d Mon Sep 17 00:00:00 2001 From: komuw Date: Tue, 3 Sep 2019 01:20:55 +0300 Subject: [PATCH 17/17] mdrrwr42 --- .circleci/config.yml | 245 ------------------------------------------- 1 file changed, 245 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 40518060..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,245 +0,0 @@ -# Golang CircleCI 2.0 configuration file -# Check https://circleci.com/docs/2.0/language-go/ for more details -# tags DOCS: https://circleci.com/docs/2.0/workflows/#git-tag-job-execution -version: 2 -jobs: - build: - docker: - - image: ubuntu:16.04 - working_directory: ~/stuff/notgopath/meli - steps: - - checkout - # the docker version specified here should be same as the docker version of the client you install. - - setup_remote_docker: - version: 18.09.3 - - run: - name: install apt and pip deps - command: | - pwd; ls -lsha - apt-get -y update - apt -y install \ - curl \ - wget \ - git \ - python \ - python-pip \ - software-properties-common \ - build-essential \ - snapd \ - snapcraft \ - nano \ - apt-transport-https \ - ca-certificates - # pip install -U pip # see; https://github.com/pypa/pip/issues/5221 - pip install -U docker-compose - - - run: - name: install golang - command: | - VER="go1.12" - wget --directory-prefix=/usr/local https://dl.google.com/go/$VER.linux-amd64.tar.gz - tar -C /usr/local -xzf /usr/local/$VER.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile - mkdir -p ~/go/bin - echo "export PATH=$PATH:~/go/bin" >> /etc/profile - echo "export LC_ALL=C.UTF-8" >> /etc/profile - echo "export LANG=C.UTF-8" >> /etc/profile - echo "export GO111MODULE=on" >> /etc/profile - source /etc/profile - - - run: - name: install tools - command: | - source /etc/profile - GOBIN_VERSION=v0.0.4 - wget -nc --directory-prefix=/tmp https://github.com/myitcv/gobin/releases/download/$GOBIN_VERSION/linux-amd64 - mv /tmp/linux-amd64 /usr/local/bin/gobin - chmod +x /usr/local/bin/gobin - gobin honnef.co/go/tools/cmd/staticcheck@2019.2.2 - - - run: - name: Install Docker client - command: | - set -x - DOCKER_VER="18.09.3" - curl -L -o /tmp/docker-$DOCKER_VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VER.tgz - tar -xz -C /tmp -f /tmp/docker-$DOCKER_VER.tgz - mv /tmp/docker/* /usr/bin - docker version - - run: source /etc/profile && go build --race -o meli cli/cli.go - - run: ./meli -v - - run: ./meli -up -d -f testdata/docker-compose.yml - - run: - name: echo number of running containers (expected=12), actual; - command: | - num_containers=$(docker ps -q | wc -l) - echo "number of containers are; $num_containers" - if [ "$num_containers" != "12" ]; then - echo "wanted 12 containers, got $num_containers" && exit 500 - fi - - run: - name: check that docker linking works - command: | - docker exec -it backup ping -w3 redis - docker exec -it backup ping -w3 eminem.com - - run: - name: check that docker .env file works - command: | - CHECK_ENV_VAR=$(docker exec -it buildservice printenv | grep NAME_IN_ENV_FILE) - echo "env var from .env file is; $CHECK_ENV_VAR" - if [[ $CHECK_ENV_VAR != *"Mutabaruka"* ]]; then - echo "wanted env var NAME_IN_ENV_FILE=Mutabaruka, got $CHECK_ENV_VAR" - fi - # remove the containers running from the previous command - - run: docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af - - run: cp meli testdata/ && cd testdata/ && ./meli -up -d - - run: - name: echo number of running containers (expected=12), actual; - command: | - num_containers=$(docker ps -q | wc -l) - echo "number of containers are; $num_containers" - if [ "$num_containers" != "12" ]; then - echo "wanted 12 containers, got $num_containers" && exit 500 - fi - - run: - name: check that docker linking works - command: | - docker exec -it backup ping -w3 redis - docker exec -it backup ping -w3 eminem.com - - run: - name: check that docker .env file works - command: | - CHECK_ENV_VAR=$(docker exec -it buildservice printenv | grep NAME_IN_ENV_FILE) - echo "env var from .env file is; $CHECK_ENV_VAR" - if [[ $CHECK_ENV_VAR != *"Mutabaruka"* ]]; then - echo "wanted env var NAME_IN_ENV_FILE=Mutabaruka, got $CHECK_ENV_VAR" - fi - # test rebuild, stop (BUT DO NOT remove) containers from previous command - # BUT because of this error; https://circleci.com/docs/1.0/docker-btrfs-error/ - # we cant do that on circleCI(though it works locally). - # so until circleCI fixes(or we run circleCI in a vm instead of a container), we need to destroy - - run: docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af - - run: ./meli -up -d -f testdata/docker-compose.yml -build - - run: - name: echo number of running containers (expected=12), actual; - command: | - all_containers=$(docker ps -aq | wc -l) - running_containers=$(docker ps -q | wc -l) - echo "number of all containers; $all_containers" - echo "number of running containers are; $running_containers" - if [ "$running_containers" != "12" ]; then - echo "wanted 12 containers, got $running_containers" && exit 500 - fi - - run: - name: go vet - command: source /etc/profile && go vet -v -all -shadow ./... - - run: - name: staticcheck - command: source /etc/profile && staticcheck -tests -show-ignored -go 1.13 -unused.whole-program ./... - - run: - name: run tests - command: source /etc/profile && go test -timeout 1m -race -cover -v ./... - - run: - name: run benchmarks - command: source /etc/profile && go test -timeout 1m -race -run=XXXX -bench=. ./... - - run: - name: codecov - command: | - source /etc/profile && \ - go test -timeout 1m -v -race -cover -coverprofile=coverage.txt ./... && \ - bash <(curl -s https://codecov.io/bash) - - # benchmark against docker-compose - - run: rm meli - - run: source /etc/profile && go build -o meli cli/cli.go - - run: docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af - - run: - name: show docker-compose version - command: docker-compose version - - run: - name: time docker-compose up - command: time docker-compose -f testdata/docker-compose.yml up -d - - run: docker ps -aq | xargs docker rm -f; docker image prune -fa; docker system prune -af - - run: - name: time meli -up - command: time ./meli -up -d -f testdata/docker-compose.yml - - run: - name: check if changes have release notes - command: | - if [ "$CIRCLE_BRANCH" == "master" ]; then - printf "\n $CIRCLE_BRANCH branch, ignoring check for relese notes \n" - else - ChangedFiles=`git diff --name-only origin/master` - case "$ChangedFiles" in - *RELEASE_NOTES.*) - printf "\n Thanks, your commits include update to release notes. \n";; - *) - printf "\n You should add release notes to .github/RELEASE_NOTES.md \n" && exit 77;; - esac - fi - - deploy: - docker: - - image: ubuntu:16.04 - working_directory: ~/stuff/notgopath/meli - steps: - - checkout - - run: - name: install apt and pip deps - command: | - apt-get -y update - apt -y install \ - curl \ - wget \ - git \ - python \ - python-pip \ - software-properties-common \ - build-essential \ - snapd \ - snapcraft \ - nano - - run: - name: install golang - command: | - VER="go1.12" - wget --directory-prefix=/usr/local https://dl.google.com/go/$VER.linux-amd64.tar.gz - tar -C /usr/local -xzf /usr/local/$VER.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile - mkdir -p ~/go/bin - echo "export PATH=$PATH:~/go/bin" >> /etc/profile - echo "export LC_ALL=C.UTF-8" >> /etc/profile - echo "export LANG=C.UTF-8" >> /etc/profile - echo "export GO111MODULE=on" >> /etc/profile - source /etc/profile - - - run: - name: go releaser - command: | - wget --directory-prefix=/usr/local https://github.com/goreleaser/goreleaser/releases/download/v0.86.1/goreleaser_Linux_x86_64.tar.gz - tar -C /usr/local -xzf /usr/local/goreleaser_Linux_x86_64.tar.gz - - run: - name: do a new release - command: | - LAST_GIT_MESSAGE=$(git log -n1 --format=oneline --pretty=%B) - echo "last git commit message on master:" - echo $LAST_GIT_MESSAGE - if [ "$LAST_GIT_MESSAGE" == 'do release' ]; then - echo "deploying with goreleaser" - source /etc/profile - /usr/local/goreleaser --rm-dist --config=.goreleaser.yml --debug --skip-validate --release-notes=.github/RELEASE_NOTES.md - fi - -workflows: - version: 2 - build-and-deploy: - jobs: - - build - - deploy: - requires: - - build - filters: - tags: - only: /^v.*/