Add json schema and cli lint command (#342)

- Add json schema file
- Add tests to validate sample pipeline files
- Add new command `lint` to cli to test a directory or single file to use correct schema

Example:  `woodpecker-cli lint ./pipeline/schema/.woodpecker/`

---
close #275 
preparation for #276 


Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Anbraten
2021-09-27 02:38:15 +02:00
committed by GitHub
parent bd19f90756
commit 0fa271f465
53 changed files with 7325 additions and 0 deletions

1
go.mod
View File

@@ -53,6 +53,7 @@ require (
github.com/urfave/cli v1.22.4
github.com/woodpecker-ci/expr v0.0.0-20210628233344-164b8b3d0915
github.com/woodpecker-ci/togo v0.0.0-20180401185031-50a0e4726e74
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/net v0.0.0-20210825183410-e898025ed96a
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d