diff --git a/ISSUE_TEMPLATE.md b/.github/issue_template.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/issue_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e69de29bb diff --git a/.gitignore b/.gitignore index be026243c..72de66e21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -drone +drone/drone drone_* *.sqlite *_gen.go diff --git a/web/hook.go b/web/hook.go index cfde989a9..f8a645c5d 100644 --- a/web/hook.go +++ b/web/hook.go @@ -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 diff --git a/engine/parser/branch.go b/yaml/branch.go similarity index 99% rename from engine/parser/branch.go rename to yaml/branch.go index 0ba73f1b5..ae426313a 100644 --- a/engine/parser/branch.go +++ b/yaml/branch.go @@ -1,4 +1,4 @@ -package parser +package yaml import ( "path/filepath" diff --git a/engine/parser/branch_test.go b/yaml/branch_test.go similarity index 99% rename from engine/parser/branch_test.go rename to yaml/branch_test.go index a2736c97e..9525ad30c 100644 --- a/engine/parser/branch_test.go +++ b/yaml/branch_test.go @@ -1,4 +1,4 @@ -package parser +package yaml import ( "testing" diff --git a/engine/shasum/shasum.go b/yaml/checksum/checksum.go similarity index 98% rename from engine/shasum/shasum.go rename to yaml/checksum/checksum.go index 3c6d504db..d87c1771a 100644 --- a/engine/shasum/shasum.go +++ b/yaml/checksum/checksum.go @@ -1,4 +1,4 @@ -package shasum +package checksum import ( "crypto/sha1" diff --git a/engine/shasum/shasum_test.go b/yaml/checksum/checksum_test.go similarity index 99% rename from engine/shasum/shasum_test.go rename to yaml/checksum/checksum_test.go index ff7c4ccc6..4bc82d898 100644 --- a/engine/shasum/shasum_test.go +++ b/yaml/checksum/checksum_test.go @@ -1,4 +1,4 @@ -package shasum +package checksum import ( "testing" diff --git a/engine/expander/expand.go b/yaml/expander/expand.go similarity index 100% rename from engine/expander/expand.go rename to yaml/expander/expand.go diff --git a/engine/expander/expand_test.go b/yaml/expander/expand_test.go similarity index 100% rename from engine/expander/expand_test.go rename to yaml/expander/expand_test.go diff --git a/engine/expander/func.go b/yaml/expander/func.go similarity index 100% rename from engine/expander/func.go rename to yaml/expander/func.go diff --git a/engine/expander/func_test.go b/yaml/expander/func_test.go similarity index 100% rename from engine/expander/func_test.go rename to yaml/expander/func_test.go diff --git a/engine/parser/matrix.go b/yaml/matrix.go similarity index 99% rename from engine/parser/matrix.go rename to yaml/matrix.go index 77bc03e45..5cb6e3763 100644 --- a/engine/parser/matrix.go +++ b/yaml/matrix.go @@ -1,4 +1,4 @@ -package parser +package yaml import ( "strings" diff --git a/engine/parser/matrix_test.go b/yaml/matrix_test.go similarity index 98% rename from engine/parser/matrix_test.go rename to yaml/matrix_test.go index 2586391de..aec2ca097 100644 --- a/engine/parser/matrix_test.go +++ b/yaml/matrix_test.go @@ -1,4 +1,4 @@ -package parser +package yaml import ( "testing" diff --git a/engine/parser/types.go b/yaml/types.go similarity index 97% rename from engine/parser/types.go rename to yaml/types.go index c1fabf887..9c1eefa56 100644 --- a/engine/parser/types.go +++ b/yaml/types.go @@ -1,4 +1,4 @@ -package parser +package yaml // stringOrSlice represents a string or an array of strings. type stringOrSlice struct { diff --git a/engine/parser/types_test.go b/yaml/types_test.go similarity index 98% rename from engine/parser/types_test.go rename to yaml/types_test.go index 48e6eb29f..8d095223f 100644 --- a/engine/parser/types_test.go +++ b/yaml/types_test.go @@ -1,4 +1,4 @@ -package parser +package yaml import ( "testing"