-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·46 lines (34 loc) · 1 KB
/
deploy.sh
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
#!/bin/bash
echo Please select your deployment state? local, test, live
read state
if [ $state == "live" ]; then
echo Please select your deployment state? up, down, build
read state
if [ $state == "build" ]; then
docker-compose up -d --build
docker push koushamad/hexagonal-core:latest
docker push koushamad/hexagonal-grafana:latest
docker-compose config > docker-compose-deploy.yaml && kompose convert -f docker-compose-deploy.yaml --out ./k8s
docker-compose down
rm -rvf docker-compose-deploy.yaml
fi
if [ $state == "up" ]; then
kubectl create -f ./k8s --save-config
fi
if [ $state == "down" ]; then
kubectl delete -f ./k8s
fi
fi
if [ $state == "test" ]; then
echo Please select your deployment state? up, down
read state
if [ $state == "up" ]; then
docker-compose up -d mongodb elassandra redis rabbitmq
fi
if [ $state == "down" ]; then
docker-compose down
fi
fi
if [ $state == "local" ]; then
docker-compose up --build --remove-orphans
fi