forked from ory/keto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (29 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY: format
format:
goreturns -w -local github.com/ory $$(listx .)
.PHONY: install-stable
install-stable:
KETO_LATEST=$$(git describe --abbrev=0 --tags)
git checkout $$KETO_LATEST
$(go env GOPATH)/bin/packr
GO111MODULE=on go install \
-ldflags "-X github.com/ory/keto/cmd.Version=$$KETO_LATEST -X github.com/ory/keto/cmd.Date=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/keto/cmd.Commit=`git rev-parse HEAD`" \
.
$(go env GOPATH)/bin/packr clean
git checkout master
.PHONY: install
install:
$(go env GOPATH)/bin/packr
GO111MODULE=on go install .
$(go env GOPATH)/bin/packr clean
# Generates the SDKs
.PHONY: sdk
sdk:
$$(go env GOPATH)/bin/swagger generate spec -m -o ./docs/api.swagger.json -x internal/httpclient
$$(go env GOPATH)/bin/swagutil sanitize ./docs/api.swagger.json
$$(go env GOPATH)/bin/swagger flatten --with-flatten=remove-unused -o ./docs/api.swagger.json ./docs/api.swagger.json
$$(go env GOPATH)/bin/swagger validate ./docs/api.swagger.json
rm -rf internal/httpclient
mkdir -p internal/httpclient
$$(go env GOPATH)/bin/swagger generate client -f ./docs/api.swagger.json -t internal/httpclient -A Ory_Keto
make format