-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (40 loc) · 1.46 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
run-tests:
@echo "Running e2e tests..."
go test -v ./services/main/tests
run-postgres:
@echo "Running PostgreSQL container..."
docker run --name alias-gen-postgres \
-e POSTGRES_USER=alias-gen \
-e POSTGRES_PASSWORD=alias-gen \
-e POSTGRES_DB=url-aliases -d -p 5432:5432 postgres
run-redis:
@echo "Running Redis container..."
docker run --name url-shortener-redis -d -p 6379:6379 redis
create-docker-network:
@echo "Creating Docker network for ClickHouse and Metabase..."
docker network create url-shortener
run-clickhouse:
@echo "Running ClickHouse container..."
docker run -d --name clickhouse-server \
--ulimit nofile=262144:262144 \
-p 9000:9000 -p 8123:8123 \
-e CLICKHOUSE_DB=testing \
-e CLICKHOUSE_SERVER__LISTEN_HOST='0.0.0.0' \
--network url-shortener \
yandex/clickhouse-server
setup-metabase-plugins:
@echo "Prepping Clickhouse plugin for Metabase..."
mkdir -p mb/plugins
curl -L -o mb/plugins/clickhouse.jar https://github.com/ClickHouse/metabase-clickhouse-driver/releases/download/1.2.2/clickhouse.metabase-driver.jar
run-metabase:
@echo "Running Metabase container..."
docker run -d -p 3000:3000 \
--network url-shortener \
--mount type=bind,source=$(shell pwd)/mb/plugins/clickhouse.jar,destination=/plugins/clickhouse.jar \
metabase/metabase:v0.47.2
run-alias-gen:
@echo "Running alias-gen service..."
go run services/alias-gen/cmd/alias-gen/main.go
run-main:
@echo "Running main service..."
go run services/main/cmd/url-shortener/main.go