This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
59 lines (50 loc) · 1.85 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
TESTENV?=environments/test
## stop: Stops running test environment containers
.PHONY: stop
stop:
@cd ${TESTENV} && docker-compose stop
## start: Starts a local test environment
.PHONY: start
start: stop build
@mkdir -p ${TESTENV}/driver
@cp cubejs.metabase-driver.jar ${TESTENV}/driver
@cd ${TESTENV} && docker-compose up
## up: Starts the local test environment but withouth compiling the driver (just a docker-compose up)
.PHONY: up
up: stop
@cd ${TESTENV} && docker-compose up
## docker: Builds the docker images for the driver building and the testing
.PHONY: docker
docker:
@echo "Building metabase-driver-builder image..."
@docker build -t metabase-driver-builder environments/build
@echo "Building cubejs-metabackend image..."
@docker build -t cubejs-metabackend ${TESTENV}/cubejs
## build: Builds the driver
.PHONY: build
build:
@rm -rf target cubejs.metabase-driver.jar
@docker run --rm -v $(shell pwd):/driver/metabase-cubejs-driver metabase-driver-builder /bin/sh -c "lein clean; DEBUG=1 LEIN_SNAPSHOTS_IN_RELEASE=true lein uberjar"
@cp target/uberjar/cubejs.metabase-driver.jar ./
## repl: Starts a local REPL server for development
repl:
docker run -it --rm -p 5555:5555 -v $(shell pwd):/driver/metabase-cubejs-driver metabase-driver-builder /bin/sh -c "lein repl :start :host 0.0.0.0 :port 5555"
## rmc: Remove the test docker containers.
.PHONY: rmc
rmc:
@echo "Removing test containers..."
@cd ${TESTENV} && docker-compose rm -s -f
## clean: Cleanups your workplace
.PHONY: clean
clean:
@echo "Removing builds..."
@rm -rf target
@echo "Removing docker containers..."
@cd ${TESTENV} && docker-compose rm -s -f
@echo "Removing docker images..."
@docker rmi metabase-driver-builder cubejs-metabackend
.PHONY: help
## help: Prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'