1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

refact yaml operations to yaml package

This commit is contained in:
Brad Rydzewski 2016-04-19 13:02:28 -07:00
parent 62ccf1bd60
commit fd63d6e03d
16 changed files with 14 additions and 14 deletions

0
.github/pull_request_template.md vendored Normal file
View File

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
drone
drone/drone
drone_*
*.sqlite
*_gen.go

View File

@ -11,13 +11,13 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/drone/drone/engine"
"github.com/drone/drone/engine/parser"
"github.com/drone/drone/model"
"github.com/drone/drone/queue"
"github.com/drone/drone/remote"
"github.com/drone/drone/shared/httputil"
"github.com/drone/drone/shared/token"
"github.com/drone/drone/store"
"github.com/drone/drone/queue"
"github.com/drone/drone/yaml"
)
var (
@ -148,13 +148,13 @@ func PostHook(c *gin.Context) {
// NOTE we don't exit on failure. The sec file is optional
}
axes, err := parser.ParseMatrix(raw)
axes, err := yaml.ParseMatrix(raw)
if err != nil {
c.String(500, "Failed to parse yaml file or calculate matrix. %s", err)
return
}
if len(axes) == 0 {
axes = append(axes, parser.Axis{})
axes = append(axes, yaml.Axis{})
}
netrc, err := remote_.Netrc(user, repo)
@ -166,7 +166,7 @@ func PostHook(c *gin.Context) {
key, _ := store.GetKey(c, repo)
// verify the branches can be built vs skipped
branches := parser.ParseBranch(raw)
branches := yaml.ParseBranch(raw)
if !branches.Matches(build.Branch) {
c.String(200, "Branch does not match restrictions defined in yaml")
return

View File

@ -1,4 +1,4 @@
package parser
package yaml
import (
"path/filepath"

View File

@ -1,4 +1,4 @@
package parser
package yaml
import (
"testing"

View File

@ -1,4 +1,4 @@
package shasum
package checksum
import (
"crypto/sha1"

View File

@ -1,4 +1,4 @@
package shasum
package checksum
import (
"testing"

View File

@ -1,4 +1,4 @@
package parser
package yaml
import (
"strings"

View File

@ -1,4 +1,4 @@
package parser
package yaml
import (
"testing"

View File

@ -1,4 +1,4 @@
package parser
package yaml
// stringOrSlice represents a string or an array of strings.
type stringOrSlice struct {

View File

@ -1,4 +1,4 @@
package parser
package yaml
import (
"testing"