-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
56 lines (48 loc) · 1.9 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
CLUSTER_NAME=kompost-test
ELIXIR_IMAGE=hexpm/elixir:1.15.0-erlang-26.0.1-alpine-3.18.2
ERLANG_IMAGE=hexpm/erlang:26.0.1-alpine-3.18.2
MANIFEST_OUT_DIR=priv/manifest
.PHONY: docker_compose
docker_compose:
docker-compose -f test/integration/docker-compose.yml up -d --remove-orphans
.PHONY: setup
#test: docker_compose
setup: ## Run integration tests using k3d `make cluster`
mix compile
mix kompost.gen.manifest
.PHONY: test
#test: docker_compose
test: ## Run integration tests using k3d `make cluster`
MIX_ENV=test mix compile
MIX_ENV=test mix kompost.gen.manifest
MIX_ENV=test mix kompost.gen.periphery
mix test --include integration --cover --timeout 30000
.PHONY: e2e
e2e: SHELL := /bin/bash
e2e:
MIX_ENV=test mix compile
MIX_ENV=test mix kompost.gen.manifest
docker buildx build --build-arg ELIXIR_IMAGE=${ELIXIR_IMAGE} --build-arg ERLANG_IMAGE=${ERLANG_IMAGE} -t kompost:e2e --load .
kind load docker-image --name ${CLUSTER_NAME} kompost:e2e
MIX_ENV=test mix kompost.gen.periphery
kubectl config use-context kind-${CLUSTER_NAME}
MIX_ENV=prod mix compile
MIX_ENV=prod mix kompost.gen.manifest --image kompost:e2e --out - | kubectl apply -f -
kubectl wait pods -n kompost -l k8s-app=kompost --for condition=Ready --timeout=300s
POSTGRES_HOST=postgres.postgres.svc.cluster.local TEMPORAL_HOST=temporal.temporal.svc.cluster.local mix test --include integration --include e2e --no-start --cover
kubectl delete ns kompost
.PHONY: delete
delete:
kind delete cluster --name kompost-test
rm -f test/integration/kubeconfig-test.yaml
kind delete cluster --name kompost-dev
rm -f test/integration/kubeconfig-dev.yaml
.PHONY: docs
docs:
docker run --name kompost-docs --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
.PHONY: helm
helm:
rm -rf ${MANIFEST_OUT_DIR}
mkdir -p ${MANIFEST_OUT_DIR}
MIX_ENV=prod mix compile
MIX_ENV=prod mix kompost.gen.manifest --image kompost:e2e --out ${MANIFEST_OUT_DIR}