Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix anchors v2 #105

Merged
merged 3 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 ./...)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.agent.alpine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.7
FROM alpine:3.9.4

RUN apk add -U --no-cache ca-certificates

Expand Down
9 changes: 0 additions & 9 deletions Dockerfile.agent.linux.arm

This file was deleted.

9 changes: 0 additions & 9 deletions Dockerfile.agent.linux.arm64

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/compiler/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

libcompose "github.com/docker/libcompose/yaml"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

type (
Expand Down
25 changes: 13 additions & 12 deletions cncd/pipeline/pipeline/frontend/yaml/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
})
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/constraint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

libcompose "github.com/docker/libcompose/yaml"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package matrix
import (
"strings"

"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package yaml
import (
"fmt"

"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/kr/pretty"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

func TestUnmarshalNetwork(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/kr/pretty"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

func TestUnmarshalSecrets(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/types/bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/franela/goblin"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

func TestBoolTrue(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package yaml
import (
"fmt"

"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion cncd/pipeline/pipeline/frontend/yaml/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/kr/pretty"
"gopkg.in/yaml.v2"
"github.com/laszlocph/yaml"
)

func TestUnmarshalVolume(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ 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=
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=
Expand Down Expand Up @@ -77,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=
Expand Down