forked from ory/oathkeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (44 loc) · 1.78 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
# Formats the code
.PHONY: format
format:
goreturns -w -local github.com/ory $$(listx .)
.PHONY: gen
gen: mocks sdk
# 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_Oathkeeper
make format
.PHONY: install-stable
install-stable:
OATHKEEPER_LATEST=$$(git describe --abbrev=0 --tags)
git checkout $$OATHKEEPER_LATEST
packr2
GO111MODULE=on go install \
-ldflags "-X github.com/ory/oathkeeper/x.Version=$$OATHKEEPER_LATEST -X github.com/ory/oathkeeper/x.Date=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/oathkeeper/x.Commit=`git rev-parse HEAD`" \
.
packr2 clean
git checkout master
.PHONY: install
install:
packr2 || (GO111MODULE=on go install github.com/gobuffalo/packr/v2/packr2 && packr2)
GO111MODULE=on go install .
packr2 clean
.PHONY: docker
docker:
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
docker build -t oryd/oathkeeper:dev .
docker build -t oryd/oathkeeper:dev-alpine -f Dockerfile-alpine .
rm oathkeeper