-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (69 loc) · 2.7 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
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2020
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
.PHONY: build
build:
for image in enb pgw sgw mme ; do \
docker build -t electrocucaracha/$$image:0.7.5 --file $$image/Dockerfile $$image ; \
done
@docker image prune --force
buildx:
for image in enb pgw sgw mme ; do \
sudo docker buildx build --platform linux/amd64,linux/arm64 -t electrocucaracha/$$image:0.7.5 --push --file $$image/Dockerfile $$image ; \
done
sudo docker image prune --force
docker-pull:
sudo $$(command -v docker-compose) --file docker/main.yml --file docker/overlay.yml --file docker/demo.yml pull
docker-deploy-demo: docker-undeploy-demo
sudo $$(command -v docker-compose) --file docker/main.yml --file docker/overlay.yml --file docker/demo.yml up --force-recreate --detach --no-build
docker-undeploy-demo:
sudo $$(command -v docker-compose) --file docker/main.yml --file docker/overlay.yml --file docker/demo.yml down --remove-orphans
docker-logs:
for service in pgw sgw mme enb; do \
echo "--- $${service} ---"; \
container=$$(sudo docker ps --filter "name=docker_$${service}_1*" --format "{{.Names}}"); \
sudo docker logs $${container}; \
done
docker-debug:
sudo $$(command -v docker-compose) --file docker/main.yml --file docker/overlay.yml --file docker/demo.yml logs --follow external_client
k8s-pull:
for img in pgw sgw mme enb; do \
sudo docker pull electrocucaracha/$${img}:0.7.5 ;\
sudo kind load docker-image electrocucaracha/$${img}:0.7.5 --name k8s;\
done
k8s-deploy-demo:
cd ./k8s; PKG_MGR=k8s ./deploy_demo.sh
k8s-undeploy-demo:
cd ./k8s; PKG_MGR=k8s ./undeploy_demo.sh
k8s-logs:
for pod in pgw sgw mme enb; do \
echo "--- $${pod} ---"; \
kubectl logs $${pod} -c $${pod} ; \
done
k8s-debug:
kubectl logs -f external-client
k8s-configure:
for pod in pgw sgw mme enb; do \
echo "--- $${pod} ---"; \
kubectl logs $${pod} -c configure ; \
done
helm-deploy-demo:
cd ./k8s; PKG_MGR=helm ./deploy_demo.sh
helm-undeploy-demo:
cd ./k8s; PKG_MGR=helm ./undeploy_demo.sh
helm-logs:
for deployment in pgw sgw mme enb; do \
echo "--- $${deployment} ---"; \
kubectl logs -l=app.kubernetes.io/name=$${deployment} -c $${deployment}; \
done
helm-debug: k8s-debug
helm-configure:
for deployment in pgw sgw mme enb; do \
echo "--- $${deployment} ---"; \
kubectl logs -l=app.kubernetes.io/name=$${deployment} -c configure; \
done