From b3343c2181f8b53689da9e367c3e82b268bf5d00 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Thu, 14 Nov 2019 11:42:35 +0100 Subject: [PATCH 1/3] Switched to Go 1.13.3 --- .drone.yml | 8 ++++---- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index ea0908d74e..90a170f6bc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ clone: pipeline: test: - image: golang:1.12.4 + image: golang:1.13.3 group: test commands: - go test -cover -timeout 30s $(go list ./...) @@ -19,7 +19,7 @@ pipeline: - make test-frontend test-postgres: - image: golang:1.12.4 + image: golang:1.13.3 group: db-test environment: - DATABASE_DRIVER=postgres @@ -28,7 +28,7 @@ pipeline: - go test -timeout 30s github.com/laszlocph/woodpecker/store/datastore test-mysql: - image: golang:1.12.4 + image: golang:1.13.3 group: db-test environment: - DATABASE_DRIVER=mysql @@ -42,7 +42,7 @@ pipeline: - make build-frontend build: - image: golang:1.12.4 + image: golang:1.13.3 commands: - go get github.com/laszlocph/togo - (cd web/; go generate ./...) diff --git a/go.mod b/go.mod index b888b69e73..9d54d91c6c 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/drone/expr v0.0.0-20170909010628-72f4df4a266b github.com/drone/signal v0.0.0-20170915013802-ac5d07ef1315 github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect - github.com/franela/goblin v0.0.0-20160123211154-889391d73023 + github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727 github.com/ghodss/yaml v0.0.0-20161207003320-04f313413ffd github.com/gin-gonic/contrib v0.0.0-20150815172543-14f66d54cdb9 github.com/gin-gonic/gin v0.0.0-20160130002857-3d002e382355 diff --git a/go.sum b/go.sum index 2b2445597e..86465f17ba 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,8 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjr github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/franela/goblin v0.0.0-20160123211154-889391d73023 h1:FwwGiDaXOnnZRvmccly64PWGmOvBmmzKkHquNOMRd4I= github.com/franela/goblin v0.0.0-20160123211154-889391d73023/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727 h1:eouy4stZdUKn7n98c1+rdUTxWMg+jvhP+oHt0K8fiug= +github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/ghodss/yaml v0.0.0-20161207003320-04f313413ffd h1:U3yHrYB7NWH2o3UFzJ1J+TknZqM9QQtF8KVIE6Qzrfs= github.com/ghodss/yaml v0.0.0-20161207003320-04f313413ffd/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-gonic/contrib v0.0.0-20150815172543-14f66d54cdb9 h1:gISPkiYdlRqAEbns25dOAoT/w5dxhI4ACWUYfTr3dFQ= From cfbbaee1ed1d4197503edf66c8309a311e70dc2f Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Thu, 14 Nov 2019 11:45:43 +0100 Subject: [PATCH 2/3] Alpine upgrade --- Dockerfile.agent.alpine | 2 +- Dockerfile.agent.linux.arm | 9 --------- Dockerfile.agent.linux.arm64 | 9 --------- Dockerfile.alpine | 2 +- 4 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 Dockerfile.agent.linux.arm delete mode 100644 Dockerfile.agent.linux.arm64 diff --git a/Dockerfile.agent.alpine b/Dockerfile.agent.alpine index eac573ebd4..10c7252bd9 100644 --- a/Dockerfile.agent.alpine +++ b/Dockerfile.agent.alpine @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.9.4 RUN apk add -U --no-cache ca-certificates diff --git a/Dockerfile.agent.linux.arm b/Dockerfile.agent.linux.arm deleted file mode 100644 index ca5ea02536..0000000000 --- a/Dockerfile.agent.linux.arm +++ /dev/null @@ -1,9 +0,0 @@ -FROM drone/ca-certs -ENV GODEBUG=netdns=go -ENV DRONE_PLATFORM=linux/arm -ADD release/linux/arm/drone-agent /bin/ - -EXPOSE 3000 -HEALTHCHECK CMD ["/bin/drone-agent", "ping"] - -ENTRYPOINT ["/bin/drone-agent"] diff --git a/Dockerfile.agent.linux.arm64 b/Dockerfile.agent.linux.arm64 deleted file mode 100644 index 0c4371970d..0000000000 --- a/Dockerfile.agent.linux.arm64 +++ /dev/null @@ -1,9 +0,0 @@ -FROM drone/ca-certs -ENV GODEBUG=netdns=go -ENV DRONE_PLATFORM=linux/arm64 -ADD release/linux/arm64/drone-agent /bin/ - -EXPOSE 3000 -HEALTHCHECK CMD ["/bin/drone-agent", "ping"] - -ENTRYPOINT ["/bin/drone-agent"] diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 2d7047220a..a87da8f16c 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.9.4 EXPOSE 8000 9000 80 443 RUN apk add -U --no-cache ca-certificates From 59d854e3d8744f671230a457b666831faa6407b2 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Thu, 14 Nov 2019 21:03:07 +0100 Subject: [PATCH 3/3] Reconstructed the previously vendored and patched yaml.v2 --- .../pipeline/frontend/yaml/compiler/params.go | 2 +- .../pipeline/pipeline/frontend/yaml/config.go | 2 +- .../pipeline/frontend/yaml/config_test.go | 25 ++++++++++--------- .../pipeline/frontend/yaml/constraint_test.go | 2 +- .../pipeline/frontend/yaml/container.go | 2 +- .../pipeline/frontend/yaml/container_test.go | 2 +- .../pipeline/frontend/yaml/matrix/matrix.go | 2 +- .../pipeline/frontend/yaml/network.go | 2 +- .../pipeline/frontend/yaml/network_test.go | 2 +- .../pipeline/frontend/yaml/secret_test.go | 2 +- .../pipeline/frontend/yaml/types/bool_test.go | 2 +- .../pipeline/pipeline/frontend/yaml/volume.go | 2 +- .../pipeline/frontend/yaml/volume_test.go | 2 +- go.mod | 2 +- go.sum | 4 +-- 15 files changed, 28 insertions(+), 27 deletions(-) diff --git a/cncd/pipeline/pipeline/frontend/yaml/compiler/params.go b/cncd/pipeline/pipeline/frontend/yaml/compiler/params.go index 5fe2390159..163f0a48dd 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/compiler/params.go +++ b/cncd/pipeline/pipeline/frontend/yaml/compiler/params.go @@ -7,7 +7,7 @@ import ( "strings" json "github.com/ghodss/yaml" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) // paramsToEnv uses reflection to convert a map[string]interface to a list diff --git a/cncd/pipeline/pipeline/frontend/yaml/config.go b/cncd/pipeline/pipeline/frontend/yaml/config.go index 9893dbf261..1f7aab43d6 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/config.go +++ b/cncd/pipeline/pipeline/frontend/yaml/config.go @@ -6,7 +6,7 @@ import ( "os" libcompose "github.com/docker/libcompose/yaml" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) type ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/config_test.go b/cncd/pipeline/pipeline/frontend/yaml/config_test.go index 79c360d19f..3f9168fc12 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/config_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/config_test.go @@ -44,19 +44,20 @@ func TestParse(t *testing.T) { g.Assert(out.RunsOn[1]).Equal("failure") g.Assert(out.SkipClone).Equal(false) }) + // Check to make sure variable expansion works in yaml.MapSlice - // g.It("Should unmarshal variables", func() { - // out, err := ParseString(sampleVarYaml) - // if err != nil { - // g.Fail(err) - // } - // g.Assert(out.Pipeline[0].Name).Equal("notify_fail") - // g.Assert(out.Pipeline[0].Image).Equal("plugins/slack") - // g.Assert(len(out.Pipeline[0].Constraints.Event.Include)).Equal(0) - // g.Assert(out.Pipeline[1].Name).Equal("notify_success") - // g.Assert(out.Pipeline[1].Image).Equal("plugins/slack") - // g.Assert(out.Pipeline[1].Constraints.Event.Include).Equal([]string{"success"}) - // }) + g.It("Should unmarshal variables", func() { + out, err := ParseString(sampleVarYaml) + if err != nil { + g.Fail(err) + } + g.Assert(out.Pipeline.Containers[0].Name).Equal("notify_fail") + g.Assert(out.Pipeline.Containers[0].Image).Equal("plugins/slack") + g.Assert(len(out.Pipeline.Containers[0].Constraints.Event.Include)).Equal(0) + g.Assert(out.Pipeline.Containers[1].Name).Equal("notify_success") + g.Assert(out.Pipeline.Containers[1].Image).Equal("plugins/slack") + g.Assert(out.Pipeline.Containers[1].Constraints.Event.Include).Equal([]string{"success"}) + }) }) }) } diff --git a/cncd/pipeline/pipeline/frontend/yaml/constraint_test.go b/cncd/pipeline/pipeline/frontend/yaml/constraint_test.go index 46436d1d5b..93bb5e9baf 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/constraint_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/constraint_test.go @@ -5,7 +5,7 @@ import ( "github.com/laszlocph/woodpecker/cncd/pipeline/pipeline/frontend" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) func TestConstraint(t *testing.T) { diff --git a/cncd/pipeline/pipeline/frontend/yaml/container.go b/cncd/pipeline/pipeline/frontend/yaml/container.go index e5975e8c02..88c9029f98 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/container.go +++ b/cncd/pipeline/pipeline/frontend/yaml/container.go @@ -4,7 +4,7 @@ import ( "fmt" libcompose "github.com/docker/libcompose/yaml" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) type ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/container_test.go b/cncd/pipeline/pipeline/frontend/yaml/container_test.go index e8c1ac1372..3b4fd1f8dd 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/container_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/container_test.go @@ -6,7 +6,7 @@ import ( libcompose "github.com/docker/libcompose/yaml" "github.com/kr/pretty" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) var containerYaml = []byte(` diff --git a/cncd/pipeline/pipeline/frontend/yaml/matrix/matrix.go b/cncd/pipeline/pipeline/frontend/yaml/matrix/matrix.go index 7177e1a2f8..a2c8ae70e6 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/matrix/matrix.go +++ b/cncd/pipeline/pipeline/frontend/yaml/matrix/matrix.go @@ -3,7 +3,7 @@ package matrix import ( "strings" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) const ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/network.go b/cncd/pipeline/pipeline/frontend/yaml/network.go index d6a2c2133d..9375fcaec1 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/network.go +++ b/cncd/pipeline/pipeline/frontend/yaml/network.go @@ -3,7 +3,7 @@ package yaml import ( "fmt" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) type ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/network_test.go b/cncd/pipeline/pipeline/frontend/yaml/network_test.go index 045ae07dbc..d1306756ac 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/network_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/network_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/kr/pretty" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) func TestUnmarshalNetwork(t *testing.T) { diff --git a/cncd/pipeline/pipeline/frontend/yaml/secret_test.go b/cncd/pipeline/pipeline/frontend/yaml/secret_test.go index d25dc8b993..be8a6bbcb2 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/secret_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/secret_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/kr/pretty" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) func TestUnmarshalSecrets(t *testing.T) { diff --git a/cncd/pipeline/pipeline/frontend/yaml/types/bool_test.go b/cncd/pipeline/pipeline/frontend/yaml/types/bool_test.go index b864349f8d..74ea754187 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/types/bool_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/types/bool_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/franela/goblin" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) func TestBoolTrue(t *testing.T) { diff --git a/cncd/pipeline/pipeline/frontend/yaml/volume.go b/cncd/pipeline/pipeline/frontend/yaml/volume.go index 346848505a..01dac31b30 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/volume.go +++ b/cncd/pipeline/pipeline/frontend/yaml/volume.go @@ -3,7 +3,7 @@ package yaml import ( "fmt" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) type ( diff --git a/cncd/pipeline/pipeline/frontend/yaml/volume_test.go b/cncd/pipeline/pipeline/frontend/yaml/volume_test.go index ba827f9cb9..d21fce087a 100644 --- a/cncd/pipeline/pipeline/frontend/yaml/volume_test.go +++ b/cncd/pipeline/pipeline/frontend/yaml/volume_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/kr/pretty" - "gopkg.in/yaml.v2" + "github.com/laszlocph/yaml" ) func TestUnmarshalVolume(t *testing.T) { diff --git a/go.mod b/go.mod index 9d54d91c6c..e8e88143c8 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( github.com/joho/godotenv v0.0.0-20150907010228-4ed13390c0ac github.com/kr/pretty v0.0.0-20160708215748-737b74a46c4b github.com/kr/text v0.0.0-20160504234017-7cafcd837844 // indirect + github.com/laszlocph/yaml v0.0.0-20191114195230-2ec4ce7a1d34 github.com/lib/pq v0.0.0-20151015211310-83c4f410d0ae github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739 // indirect github.com/mattn/go-sqlite3 v0.0.0-20170901084005-05548ff55570 @@ -58,5 +59,4 @@ require ( google.golang.org/grpc v0.0.0-20170626232044-9cb02b885b41 gopkg.in/go-playground/assert.v1 v1.2.1 // indirect gopkg.in/go-playground/validator.v8 v8.17.1 // indirect - gopkg.in/yaml.v2 v2.2.1 ) diff --git a/go.sum b/go.sum index 86465f17ba..733c331ffe 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,6 @@ github.com/drone/signal v0.0.0-20170915013802-ac5d07ef1315 h1:pNSCIqkfTtVWwSHCOz github.com/drone/signal v0.0.0-20170915013802-ac5d07ef1315/go.mod h1:S8t92eFT0g4WUgEc/LxG+LCuiskpMNsG0ajAMGnyZpc= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/franela/goblin v0.0.0-20160123211154-889391d73023 h1:FwwGiDaXOnnZRvmccly64PWGmOvBmmzKkHquNOMRd4I= -github.com/franela/goblin v0.0.0-20160123211154-889391d73023/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727 h1:eouy4stZdUKn7n98c1+rdUTxWMg+jvhP+oHt0K8fiug= github.com/franela/goblin v0.0.0-20181003173013-ead4ad1d2727/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/ghodss/yaml v0.0.0-20161207003320-04f313413ffd h1:U3yHrYB7NWH2o3UFzJ1J+TknZqM9QQtF8KVIE6Qzrfs= @@ -79,6 +77,8 @@ github.com/kr/pretty v0.0.0-20160708215748-737b74a46c4b h1:LJ9zj3Zit+pLjAQtA1gxl github.com/kr/pretty v0.0.0-20160708215748-737b74a46c4b/go.mod h1:Bvhd+E3laJ0AVkG0c9rmtZcnhV0HQ3+c3YxxqTvc/gA= github.com/kr/text v0.0.0-20160504234017-7cafcd837844 h1:kpzneEBeC0dMewP3gr/fADv1OlblH9r1goWVwpOt3TU= github.com/kr/text v0.0.0-20160504234017-7cafcd837844/go.mod h1:sjUstKUATFIcff4qlB53Kml0wQPtJVc/3fWrmuUmcfA= +github.com/laszlocph/yaml v0.0.0-20191114195230-2ec4ce7a1d34 h1:+4tKButWtRq7Xw8EUpabOmZYAk2gtinHF585AmWu2Qk= +github.com/laszlocph/yaml v0.0.0-20191114195230-2ec4ce7a1d34/go.mod h1:E1nYupUAMCOPyW4ZX78x63SP3/nKFQ5aj8tlwzMdYuo= github.com/lib/pq v0.0.0-20151015211310-83c4f410d0ae h1:rBqRT7VqVLePKGtyV6xDFLXeqD56CvZKEqI0XWzVTxM= github.com/lib/pq v0.0.0-20151015211310-83c4f410d0ae/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/manucorporat/sse v0.0.0-20160126180136-ee05b128a739 h1:ykXz+pRRTibcSjG1yRhpdSHInF8yZY/mfn+Rz2Nd1rE=