-
Notifications
You must be signed in to change notification settings - Fork 110
/
Makefile
36 lines (27 loc) · 903 Bytes
/
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
GIT_COMMITSHA = $(shell git rev-parse HEAD)
IMAGE_NAME = "stripe/stripe-mock"
OPENAPI_BRANCH ?= master
all: test vet lint check-gofmt build
build:
go build -mod=vendor -o stripe-mock
check-gofmt:
scripts/check_gofmt.sh
lint:
staticcheck
test:
# -count=1 disables the cache
go test ./... -count=1
vet:
go vet ./...
docker-build:
docker build -t "$(IMAGE_NAME):latest" -t "$(IMAGE_NAME):$(GIT_COMMITSHA)" .
.PHONY: docker-build
docker-run:
docker run --rm -it -p 12111-12112:12111-12112 "$(IMAGE_NAME):latest"
.PHONY: docker-run
update-openapi-spec:
rm -f ./embedded/openapi/spec3.json
rm -f ./embedded/openapi/fixtures3.json
wget https://raw.githubusercontent.com/stripe/openapi/$(OPENAPI_BRANCH)/openapi/spec3.json -P ./embedded/openapi
wget https://raw.githubusercontent.com/stripe/openapi/$(OPENAPI_BRANCH)/openapi/fixtures3.json -P ./embedded/openapi
.PHONY: update-openapi-spec