-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
31 lines (25 loc) · 964 Bytes
/
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
.PHONY: default
default:
@echo "Development:"
@echo " make deps -- Install dependencies"
@echo " make graphs -- Compile Mermaid graphs"
@echo " make sync -- Synchronize local cookbook to remote server"
@echo " make deploy -- Deploy pipelines on remote server"
.PHONY: deps
deps:
yarn
.PHONY: graphs
graphs: $(wildcard img/*.mmd.svg)
img/%.mmd.svg: img/%.mmd
npx mmdc -i $< -o $@
SSH_USERNAME ?= root
SSH_HOST ?= placeholder.example.com
SSH_WORKDIR ?= cookbook
.PHONY: sync
sync:
rsync --recursive --delete --exclude node_modules . $(SSH_USERNAME)@$(SSH_HOST):$(SSH_WORKDIR)
.PHONY: deploy
deploy: sync
ssh -t $(SSH_USERNAME)@$(SSH_HOST) "pushd $(SSH_WORKDIR)/ingest; docker compose pull; docker compose up -d"
ssh -t $(SSH_USERNAME)@$(SSH_HOST) "pushd $(SSH_WORKDIR)/process; docker compose pull; docker compose up -d"
ssh -t $(SSH_USERNAME)@$(SSH_HOST) "pushd $(SSH_WORKDIR)/process-clickhouse; docker compose pull; docker compose up -d"