-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
118 lines (97 loc) · 2.86 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
SHELL := /bin/bash
# defining variables for the make file. Specifying default values if these values are not passed in by the caller
docker_tag ?= latest
java_components := oms api persister
#components := $(java_components) frontend
#components := $(java_components) assetcache
components := $(java_components)
docker_repository ?= quokka
.PHONY: docker-build
docker-build:
for component in $(components); do \
docker buildx build -t $(docker_repository)/$$component:$(docker_tag) . -f $$component/Dockerfile ; \
done && \
pushd frontend && \
docker buildx build -t $(docker_repository)/frontend:$(docker_tag) . && \
popd && \
pushd assetcache && \
docker buildx build -t $(docker_repository)/assetcache:$(docker_tag) . && \
popd
.PHONY: docker-push
docker-push:
for component in $(components); do \
docker push $(docker_repository)/$$component:$(docker_tag) ; \
done && \
pushd frontend && \
docker push $(docker_repository)/frontend:$(docker_tag) && \
popd && \
pushd assetcache && \
docker push $(docker_repository)/assetcache:$(docker_tag) && \
popd
.PHONY: mvn-build
mvn-build:
mvn clean install --file common/pom.xml
for component in $(java_components); do \
mvn clean package -DskipTests --file $$component/pom.xml ; \
done
.PHONY: mvn-test
mvn-test: mvn-build
for component in $(java_components); do \
mvn test --file $$component/pom.xml ; \
done
.PHONY: build
build: mvn-build docker-build
.PHONY: up
up:
docker-compose up -d
.PHONY: logs
logs:
docker-compose logs -f --since 5s
.PHONY: down
down:
docker-compose down
.PHONY: frontend-build
frontend-build:
pushd frontend && \
docker buildx build -t $(docker_repository)/frontend:$(docker_tag) . && \
popd
.PHONY: assetcache-build
assetcache-build:
pushd assetcache && \
docker buildx build -t $(docker_repository)/assetcache:$(docker_tag) . && \
popd
.PHONY: oms-build
oms-build:
docker buildx build -t $(docker_repository)/oms:$(docker_tag) . -f oms/Dockerfile
.PHONY: api-build
api-build:
docker buildx build -t $(docker_repository)/api:$(docker_tag) . -f api/Dockerfile
.PHONY: persister-build
persister-build:
docker buildx build -t $(docker_repository)/persister:$(docker_tag) . -f persister/Dockerfile
.PHONY: last-container-logs
last-container-logs:
docker logs -f $$(docker container ls -n 1 -q)
.PHONY: download-dashboards
download-dashboards:
./scripts/download_dashboards.sh
.PHONY: oms-loadtest
oms-loadtest:
./scripts/oms.sh
.PHONY: api-user-loadtest
api-user-loadtest:
./scripts/api_users.sh
.PHONY: api-order-loadtest
api-order-loadtest:
./scripts/api_orders.sh
.PHONY: create-database
create-database:
docker-compose create postgres
docker-compose start postgres
sleep 5
docker exec postgres psql -U postgres -c "CREATE DATABASE quokka;"
.PHONY: deletedb
deletedb: down
rm -rf volumes/postgres
.PHONY: resetdb
resetdb: deletedb create-database