Skip to content

Commit

Permalink
fix: use ory-dev instead of swagutil (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Jun 8, 2020
1 parent f1a49e8 commit 3fce382
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 39 deletions.
1 change: 1 addition & 0 deletions .bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.1

orbs:
sdk: ory/[email protected].33
sdk: ory/[email protected].35
changelog: ory/[email protected]
goreleaser: ory/[email protected]
slack: circleci/[email protected]
nancy: ory/[email protected].9
nancy: ory/[email protected].10
docs: ory/[email protected]
golangci: ory/[email protected]

Expand Down
44 changes: 30 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
SHELL=/bin/bash -o pipefail

.PHONY: tools
tools:
GO111MODULE=on go install github.com/ory/go-acc github.com/ory/x/tools/listx github.com/go-swagger/go-swagger/cmd/swagger github.com/sqs/goreturns github.com/ory/sdk/swagutil
export GO111MODULE := on
export PATH := .bin:${PATH}

.PHONY: deps
deps:
ifneq ("$(shell base64 Makefile))","$(shell cat .bin/.lock)")
go build -o .bin/go-acc github.com/ory/go-acc
go build -o .bin/goreturns github.com/sqs/goreturns
go build -o .bin/listx github.com/ory/x/tools/listx
go build -o .bin/mockgen github.com/golang/mock/mockgen
go build -o .bin/swagger github.com/go-swagger/go-swagger/cmd/swagger
go build -o .bin/goimports golang.org/x/tools/cmd/goimports
go build -o .bin/ory-dev github.com/ory/meta/tools/ory-dev
go build -o .bin/packr2 github.com/gobuffalo/packr/v2/packr2
go build -o .bin/go-bindata github.com/go-bindata/go-bindata/go-bindata
echo "v0" > .bin/.lock
echo "$$(base64 Makefile)" > .bin/.lock
endif

# Formats the code
.PHONY: format
format:
format: deps
goreturns -w -local github.com/ory $$(listx .)

.PHONY: gen
gen: mocks sdk
gen:
mocks sdk

# Generates the SDKs
.PHONY: sdk
sdk:
$$(go env GOPATH)/bin/swagger generate spec -m -o ./.schema/api.swagger.json -x internal/httpclient
$$(go env GOPATH)/bin/swagutil sanitize ./.schema/api.swagger.json
$$(go env GOPATH)/bin/swagger flatten --with-flatten=remove-unused -o ./.schema/api.swagger.json ./.schema/api.swagger.json
$$(go env GOPATH)/bin/swagger validate ./.schema/api.swagger.json
sdk: deps
swagger generate spec -m -o ./.schema/api.swagger.json -x internal/httpclient
ory-dev swagger sanitize ./.schema/api.swagger.json
swagger flatten --with-flatten=remove-unused -o ./.schema/api.swagger.json ./.schema/api.swagger.json
swagger validate ./.schema/api.swagger.json
rm -rf internal/httpclient
mkdir -p internal/httpclient
$$(go env GOPATH)/bin/swagger generate client -f ./.schema/api.swagger.json -t internal/httpclient -A Ory_Oathkeeper
swagger generate client -f ./.schema/api.swagger.json -t internal/httpclient -A Ory_Oathkeeper
make format

.PHONY: install-stable
install-stable:
install-stable: deps
OATHKEEPER_LATEST=$$(git describe --abbrev=0 --tags)
git checkout $$OATHKEEPER_LATEST
packr2
Expand All @@ -36,13 +52,13 @@ install-stable:
git checkout master

.PHONY: install
install:
install: deps
packr2 || (GO111MODULE=on go install github.com/gobuffalo/packr/v2/packr2 && packr2)
GO111MODULE=on go install .
packr2 clean

.PHONY: docker
docker:
docker: deps
packr2 || (GO111MODULE=on go install github.com/gobuffalo/packr/v2/packr2 && packr2)
CGO_ENABLED=0 GO111MODULE=on GOOS=linux GOARCH=amd64 go build
packr2 clean
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
github.com/gobwas/glob v0.2.3
github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2
github.com/golang/mock v1.3.1
github.com/golang/protobuf v1.3.3 // indirect
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.7.1 // indirect
github.com/gorilla/websocket v1.4.2
Expand All @@ -35,16 +34,16 @@ require (
github.com/mitchellh/copystructure v1.0.0
github.com/ory/analytics-go/v4 v4.0.1
github.com/ory/fosite v0.29.2
github.com/ory/go-acc v0.2.1
github.com/ory/go-acc v0.2.3
github.com/ory/go-convenience v0.1.0
github.com/ory/gojsonschema v1.2.0
github.com/ory/graceful v0.1.1
github.com/ory/herodot v0.8.4
github.com/ory/jsonschema/v3 v3.0.1
github.com/ory/ladon v1.1.0
github.com/ory/sdk/swagutil v0.0.0-20200525104141-b009efcf4f04
github.com/ory/meta/tools/ory-dev v0.0.0-20200608154018-9d325ca2087d
github.com/ory/viper v1.7.5
github.com/ory/x v0.0.126
github.com/ory/x v0.0.128
github.com/pborman/uuid v1.2.0
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/errors v0.9.1
Expand All @@ -55,14 +54,15 @@ require (
github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518
github.com/square/go-jose v2.3.1+incompatible
github.com/stretchr/testify v1.5.1
github.com/tidwall/gjson v1.3.5
github.com/tidwall/sjson v1.0.4
github.com/tidwall/gjson v1.6.0
github.com/tidwall/sjson v1.1.1
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce
github.com/urfave/negroni v1.0.0
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/tools v0.0.0-20200325203130-f53864d0dba1
google.golang.org/grpc v1.29.1 // indirect
gopkg.in/square/go-jose.v2 v2.3.1
)

Expand Down
Loading

0 comments on commit 3fce382

Please sign in to comment.