-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
29 lines (27 loc) · 1.35 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
build:
# build images
echo "Building docker images..."
# set minikube env to reference local images
eval $(minikube docker-env); docker build -t api-service .
eval $(minikube docker-env); docker build -t coindesk -f microservice.docker . --build-arg MAIN_ARG="-coindesk"
eval $(minikube docker-env); docker build -t twitterscraper -f microservice.docker . --build-arg MAIN_ARG="-twitterscraper"
echo "Completed building docker images..."
deploy:
# deploy kubernetes
echo "Deploying kubernetes microservices..."
eval $(minikube docker-env); minikube kubectl -- apply -f coindesk-deployment.yaml
eval $(minikube docker-env); minikube kubectl -- apply -f twitterscraper-deployment.yaml
eval $(minikube docker-env); minikube kubectl -- apply -f api-service-deployment.yaml
eval $(minikube docker-env); minikube kubectl -- get deployments
eval $(minikube docker-env); minikube dashboard
echo "Done deploying kubernetes microservices."
clean:
# clean go cache
go clean -modcache
# clean docker images
docker system prune -f
echo "cleaning kubernetes default namespace"
eval $(minikube docker-env); kubectl delete -f coindesk-deployment.yaml
eval $(minikube docker-env); kubectl delete -f twitterscraper-deployment.yaml
eval $(minikube docker-env); kubectl delete -f api-service-deployment.yaml
eval $(minikube docker-env); kubectl -n default delete pod,svc --all