-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (57 loc) · 1.42 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
.DEFAULT_GOAL := build
PODNAME := showcase
PG_USER := postgres
PG_PASS := postgres
define JSON_TODO
curl -X 'POST' \
'http://localhost:8080/todo' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"description": "Todo string",
"title": "Todo string"
}'
endef
export JSON_TODO
# Tools
todo:
@echo $$JSON_TODO | bash
list:
@curl -X 'GET' 'http://localhost:8080/todo' -H 'accept: */*' | jq .
hurl:
@hurl ./todo.hurl
# Build & run
build-all:
mvn package
build-ktor:
mvn package -pl todo-service-ktor
build-quarkus:
mvn package -pl todo-service-quarkus
run-ktor:
java -jar todo-service-ktor/target/todo-service-ktor-0.1-jar-with-dependencies.jar
run-quarkus:
java -jar todo-service-quarkus/target/quarkus-app/quarkus-run.jar
# Podman
pd-machine-init:
podman machine init --memory=8192 --cpus=2 --disk-size=20
pd-machine-start:
podman machine start
pd-machine-stop:
podman machine stop
pd-machine-rm:
@podman machine rm
pd-machine-recreate: pd-machine-rm pd-machine-init pd-machine-start
pd-pod-create:
@podman pod create -n $(PODNAME) --network bridge \
-p 5432:5432 -p 8500:8500
pd-pod-rm:
podman pod rm -f $(PODNAME)
pd-pod-recreate: pd-pod-rm pd-pod-create
pd-consul:
@podman run -dit --name consul --pod=$(PODNAME) \
consul:latest
pd-postgres:
@podman run -dit --name postgres --pod=$(PODNAME) \
-e POSTGRES_USER=$(PG_USER) \
-e POSTGRES_PASSWORD=$(PG_PASS) \
postgres:latest