diff --git a/README.md b/README.md deleted file mode 100644 index fba182a4529394951195b2055e42e4c9253ea22b..0000000000000000000000000000000000000000 --- a/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# jsonnetpecker - -A [Woodpecker Config Extension](https://woodpecker-ci.org/docs/usage/extensions/configuration-extension) to parse [jsonnet](https://jsonnet.org/) configs. - -## License - -[MIT](LICENSE) diff --git a/go.mod b/go.mod index c044e393319193e19c7f23b1b525828d4fef9bd1..11a7c36fc249b635ddf55c2171df4cc7f03ddbd8 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ github.com/go-chi/chi/v5 v5.2.3 github.com/google/go-jsonnet v0.21.0 github.com/peterbourgon/ff/v3 v3.4.0 github.com/yaronf/httpsign v0.4.1 - go.jolheiser.com/ffjsonnet v0.0.0-20240816163546-0d0f7d30cc19 gopkg.in/yaml.v3 v3.0.1 ) @@ -33,5 +32,6 @@ github.com/segmentio/asm v1.2.1 // indirect github.com/valyala/fastjson v1.6.4 // indirect golang.org/x/crypto v0.43.0 // indirect golang.org/x/sys v0.37.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index d3d80877ed13de722841fc52fcf85282141baf0f..f80a6722765844e1ae2fae61c8dd18d1ff69e2b6 100644 --- a/go.sum +++ b/go.sum @@ -60,14 +60,14 @@ github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ= github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= github.com/yaronf/httpsign v0.4.1 h1:q2yLLkL4+8G9VmOBR6SIsD4+00ncjt+GyadGA3weY0Y= github.com/yaronf/httpsign v0.4.1/go.mod h1:euOXi3++HLtx5YlsJEWcIzF3ztK4TL2M2F0Wg3KL+V0= -go.jolheiser.com/ffjsonnet v0.0.0-20240816163546-0d0f7d30cc19 h1:QRSdc/EmohEl+TkCU/l2frlwSIVR72HOZ1vHHhDwSwA= -go.jolheiser.com/ffjsonnet v0.0.0-20240816163546-0d0f7d30cc19/go.mod h1:uW2oeieTw8qhLnwhImqMyGFFMW60mKgIoCp2JxtUHOQ= golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 8b22f43e0407c32e4b9fc2f0e2eceec185f748f2..897822f4e2e5ec3f75a4e0465c16a1e3fcf17fc0 100644 --- a/main.go +++ b/main.go @@ -18,8 +18,8 @@ "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/google/go-jsonnet" "github.com/peterbourgon/ff/v3" + "github.com/peterbourgon/ff/v3/ffyaml" "github.com/yaronf/httpsign" - "go.jolheiser.com/ffjsonnet" "gopkg.in/yaml.v3" ) @@ -37,7 +37,7 @@ func maine() error { var args args fs := flag.NewFlagSet("jsonnetpecker", flag.ExitOnError) - fs.String("config", ".config.jsonnet", "Path to config file") + fs.String("config", ".config.yaml", "Path to config file") fs.IntVar(&args.port, "port", args.port, "Port to listen on") fs.IntVar(&args.port, "p", args.port, "--port") fs.StringVar(&args.pubKey, "public-key", args.pubKey, "Woodpecker public key for verification") @@ -66,7 +66,7 @@ fs.BoolVar(&args.logJSON, "j", args.logJSON, "--json") if err := ff.Parse(fs, os.Args[1:], ff.WithConfigFileFlag("config"), ff.WithAllowMissingConfigFile(true), - ff.WithConfigFileParser(ffjsonnet.Parser), + ff.WithConfigFileParser(ffyaml.Parser), ff.WithEnvVarPrefix("JSONNETPECKER"), ); err != nil { return err