-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
93 lines (78 loc) · 3.06 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.DEFAULT_GOAL := run
SHELL := /bin/bash
APP ?= $(shell basename $$(pwd))
COMMIT_SHA = $(shell git rev-parse --short HEAD)
.PHONY: help
## help: prints this help message
help:
@echo "Usage:"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
.PHONY: run
## run: runs main.go with the race detector
run:
source .env; source .env_*; go run -race main.go
.PHONY: gin
## gin: runs main.go via gin (hot reloading)
gin:
gin --all --immediate run main.go
.PHONY: build
## build: builds the application
build: clean
@echo "Building binary ..."
go build -o ${APP}
.PHONY: clean
## clean: cleans up binary files
clean:
@echo "Cleaning up ..."
@go clean
.PHONY: test
## test: runs go test with the race detector
test:
@source .env; GOARCH=amd64 GOOS=linux go test -v -race ./...
.PHONY: init
## init: sets up go modules
init:
@echo "Setting up modules ..."
@go mod init 2>/dev/null; go mod tidy && go mod vendor
.PHONY: provision-instance
## provision-instance: creates an example service instance
provision-instance:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc?accepts_incomplete=true \
-X PUT -H "Content-Type: application/json" \
-d '{ "service_id":"e27ea95a-3883-44f2-8ca4-01101f39d50c", "plan_id":"355ef4a4-08f5-4764-b4ed-8353812b6963" }'
.PHONY: poll-instance
## poll-instance: queries last_operation of example service instance
poll-instance:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc/last_operation \
-X GET
.PHONY: fetch-instance
## fetch-instance: queries example service instance
fetch-instance:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc \
-X GET
.PHONY: update-instance
## update-instance: updates example service instance
update-instance:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc?accepts_incomplete=true \
-X PATCH -H "Content-Type: application/json" \
-d '{ "service_id":"e27ea95a-3883-44f2-8ca4-01101f39d50c", "plan_id":"ae2bda53-fe15-4335-9422-774aae3e7e32" }'
.PHONY: deprovision-instance
## deprovision-instance: deletes example service instance
deprovision-instance:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc?accepts_incomplete=true \
-X DELETE
.PHONY: create-binding
## create-binding: creates binding for example service instance
create-binding:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc/service_bindings/deadbeef \
-X PUT
.PHONY: fetch-binding
## fetch-binding: queries binding for example service instance
fetch-binding:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc/service_bindings/deadbeef \
-X GET
.PHONY: remove-binding
## remove-binding: removes binding for example service instance
remove-binding:
curl -v http://disco:dingo@localhost:9999/v2/service_instances/fe5556b9-8478-409b-ab2b-3c95ba06c5fc/service_bindings/deadbeef \
-X DELETE