-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
76 lines (54 loc) · 1.59 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
.PHONY: build_tools deps compile tests start_dev_env stop_dev_env integration_tests rm_offset_storage
build_tools:
mix local.hex --force
mix local.rebar --force
deps:
mix deps.get
dialyzer:
mix dialyzer
compile:
mix compile
release:
MIX_ENV="prod" mix release
pretest_compile: deps
MIX_ENV="test" mix compile --force --warnings-as-error
tests:
mix test
format:
mix format
check-format:
mix format --check-formatted
DC_CONFIG=compose.yaml
start_dev_env:
docker-compose -f ${DC_CONFIG} up -d
stop_dev_env:
docker-compose -f ${DC_CONFIG} down
DOCKER_PREFIX:=$(shell basename $(CURDIR))
docker-pgsql-%:
docker exec -it -e PGPASSWORD=password ${DOCKER_PREFIX}_$*_1 psql -h $* -U electric -d electric
docker-build:
docker build -t electric:local-build .
docker-build-ci:
docker pull ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_IMAGE_TAG} || true
docker pull ${ELECTRIC_IMAGE_NAME}:latest || true
docker build --cache-from ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_IMAGE_TAG} \
--cache-from ${ELECTRIC_IMAGE_NAME}:latest \
-t ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_IMAGE_TAG} \
-t electric:local-build .
docker push ${ELECTRIC_IMAGE_NAME}:${ELECTRIC_IMAGE_TAG}
docker-clean:
ifneq ($(docker images -q electric:local-build 2> /dev/null), "")
docker image rm -f electric:local-build
endif
rm_offset_storage:
rm vx_pg_offset_storage_*
update_protobuf: deps
mix protox.generate \
--output-path=./lib/electric/satellite/satellite_pb.ex \
./deps/satellite_proto/proto/satellite.proto
shell:
iex -S mix
shell_clean:
iex -S mix run --no-start
apply_migration:
./apply-local-migration.sh $(name)