-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
78 lines (61 loc) · 2.36 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
dc = docker-compose -f docker-compose.yml
user_id:=$(shell id -u)
group_id:=$(shell id -g)
DOCKER = docker
BUILDX = $(DOCKER) buildx
PLATFORMS = linux/amd64,linux/arm64
BUILDX_ARGS = --platform ${PLATFORMS} --allow security.insecure --push
BUILDER_NAME = valmi-docker-builder
ECHO = echo
# Get all the connectors sub direcotries
CONNECTORS := $(shell find valmi-integrations/connectors -maxdepth 1 -type d -not -path .)
build:
docker build . -t valmi/valmi-activation --build-arg USER_ID=$(user_id) --build-arg GROUP_ID=$(group_id)
run:
$(dc) up -d valmi-activation
compile-requirements:
$(dc) run --rm valmi-activation bash -c "\
python -m pip install pip-tools && \
pip-compile -U -o requirements/requirements.txt && \
pip-compile -U requirements/test-requirements.in -o requirements/test-requirements.txt"
alembic-revision:
$(dc) run --rm valmi-activation bash -c "cd src && alembic revision --autogenerate -m $(msg)"
setup-db:
$(dc) run --rm valmi-activation bash -c "cd src && alembic upgrade head"
setup-buildx:
$(DOCKER) run --privileged --rm tonistiigi/binfmt --install all
$(BUILDX) rm $(BUILDER_NAME) || true
$(BUILDX) create --name $(BUILDER_NAME) --driver docker-container --bootstrap --buildkitd-flags '--allow-insecure-entitlement security.insecure'
$(BUILDX) use $(BUILDER_NAME)
build-connector:
$(MAKE) -C valmi-integrations/connectors/$(connector_name) build_docker
build-and-push-connector:
$(MAKE) -C valmi-integrations/connectors/$(connector_name) build_and_push
build-connectors-all:
@for dir in $(CONNECTORS); do \
if [ -f $$dir/Makefile ]; then \
$(MAKE) -C $$dir build_docker; \
fi \
done
build-and-push-connectors-all:
@for dir in $(CONNECTORS); do \
if [ -f $$dir/Makefile ]; then \
$(MAKE) -C $$dir build_and_push; \
fi \
done
build-and-push-valmi-dagster:
$(MAKE) -C dagster build-and-push-valmi-dagster
build-and-push-valmi-repo:
$(MAKE) -C dagster build-and-push-valmi-repo
build-and-push-valmi-activation-base:
$(BUILDX) build $(BUILDX_ARGS) \
--cache-from valmiio/valmi-activation:base \
-t valmiio/valmi-activation:base \
-f Dockerfile.base .
build-and-push-valmi-activation:
$(BUILDX) build $(BUILDX_ARGS) \
--cache-from valmiio/valmi-activation:latest \
-t valmiio/valmi-activation:${valmi_activation_version} \
-t valmiio/valmi-activation:stable \
-t valmiio/valmi-activation:latest \
-f Dockerfile.prod .