-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
129 lines (103 loc) · 3.14 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
119
120
121
122
123
124
125
126
127
128
129
# this makefile will install the required python packages for each component
SHELL:=/usr/bin/zsh
PYTHON_COMPONENTS=data-api data-generator dashboard-plotly dashboard-nicegui
NODE_PROJECT_DIR=dashboard-angular/dashboard
VERSION=3.11.1
PYTHON=${VENV_DIR}/bin/python
.PHONY: install
install:
for component in $(PYTHON_COMPONENTS); do \
pushd $$component; \
pip install --upgrade pip; \
pyenv virtualenv --force $(VERSION) $$component; \
pyenv activate $$component; \
pip install -r requirements.txt; \
pip install -r requirements-dev.txt; \
popd; \
done;
pushd $(NODE_PROJECT_DIR); \
npm install; \
popd;
# delete all the python virtual environments
.PHONY: clean
clean:
for component in $(PYTHON_COMPONENTS); do \
pyenv virtualenv-delete -f $$component; \
done;
pushd $(NODE_PROJECT_DIR); \
rm -rf node_modules; \
popd;
.PHONY: compose-build
compose-build:
docker compose build
.PHONY: compose-up
compose-up:
docker compose up -d
.PHONY: compose-down
compose-down:
docker compose down
.PHONY: compose-clean
compose-clean:
docker compose down --rmi all --volumes
.PHONY: test
test:
docker compose -f docker-compose.test.yaml up --build --abort-on-container-exit
.PHONY: cloc
cloc:
cloc --exclude-dir=$(tr '\n' ',' < .clocignore) .
.PHONY: tf-docs
tf-docs:
terraform-docs markdown table --output-file README.md --output-mode inject deployment/terraform
.PHONY: tf-init
tf-init:
terraform -chdir=deployment/terraform init
.PHONY: tf-plan
tf-plan:
terraform -chdir=deployment/terraform plan
.PHONY: tf-apply
tf-apply:
terraform -chdir=deployment/terraform apply
.PHONY: tf-destroy
tf-destroy:
terraform -chdir=deployment/terraform/ destroy
.PHONY: tf-fmt
tf-fmt:
terraform fmt -recursive deployment/terraform
.PHONY: localstack-start
localstack-start:
docker run -d --name=localstack -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack
.PHONY: localstack-stop
localstack-stop:
docker stop localstack
.PHONY: localstack-destroy
localstack-destroy:
docker rm localstack
.PHONY: tflocal
tflocal:
@which tflocal > /dev/null || (echo "tflocal not found, installing" && pip install tflocal)
.PHONY: tflocal-init
tflocal-init: tflocal
pushd deployment/terraform && tflocal init && popd
.PHONY: tflocal-plan
tflocal-plan: tflocal
pushd deployment/terraform && tflocal plan && popd
.PHONY: tflocal-apply
tflocal-apply: tflocal
pushd deployment/terraform && tflocal apply && popd
.PHONY: tflocal-destroy
tflocal-destroy: tflocal
pushd deployment/terraform && tflocal destroy && popd
.PHONY: setup-kind
setup-kind:
@which kind > /dev/null || (echo "kind not found, installing" && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.18.0/kind-windows-amd64 && chmod +x ./kind && sudo mv ./kind /usr/local/bin/kind)
.PHONY: kind-create
kind-create: setup-kind
kind create cluster --config deployment/kind/kind-config.yaml
.PHONY: show-dkr-images
show-dkr-images:
docker images | grep $(basename $(pwd))
.PHONY: load-dkr-images
load-dkr-images:
docker compose -f docker-compose.yaml build
docker images | grep $(basename $(pwd)) | awk '{ print $1":"$2 }' | xargs -I{} kind load docker-image {}
kind load docker-image --name timeseries-cluster mongo:latest