-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
49 lines (36 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
.DEFAULT_GOAL := all
SHELL := /bin/bash
COMPONENTS ?=
P2P_DIST_DIR := dist/
P2P_BUILDER_IMAGE := pandastoproduction-builder:latest
P2P_WHL := $(P2P_DIST_DIR)/pandastoproduction-0.1.0-py3-none-any.whl
.PHONY: help
help: ## Display makefile target descriptions.
@printf -- "\nPandas to Production.\n\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: compose-up
compose-up: ## Start the docker-compose stack.
@COMPONENTS=$(subst ',',' ',$(COMPONENTS))
docker-compose build $(COMPONENTS)
docker-compose up -d $(COMPONENTS)
.PHONY: compose-down
compose-down: ## Stop the docker-compose stack.
docker-compose down --remove-orphans --volumes
.PHONY: build-whl
build-whl: ## Build the p2p library.
@printf -- "Building wheel: $(P2P_WHL)\n"
cp -r components/frontend/src/components/chart components/p2p/js/src/components/
cp -r components/frontend/src/assets components/p2p/js/src/components/
cp components/frontend/src/style.css components/p2p/js/src/components/
docker build -f components/p2p/Dockerfile -t $(P2P_BUILDER_IMAGE) components/p2p
docker run --rm -v $(PWD)/dist:/dist $(P2P_BUILDER_IMAGE)
.PHONY: clean
clean: ## Remove temporary directories.
-rm -rf dist components/jupyter/dist
.PHONY: all
all: ## Runs all steps to have a working demo.
make clean
make compose-down
make build-whl
cp -r dist components/jupyter/
make compose-up