-
Notifications
You must be signed in to change notification settings - Fork 658
/
kraken.sh
88 lines (64 loc) · 2.06 KB
/
kraken.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
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
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
function setup-swarm {
# first we go to our docker folder
cd _docker_setup
echo '···························'
echo '·· setting up the swarm >>>> ··'
echo '···························'
# we create and init the swarm cluster
(bash < ./setup-swarm.sh)
# we go back to the root project
cd ..
}
function setup-mongo {
echo '···························'
echo '·· <<<< git clone the mongodb cluster ··'
echo '···························'
rm -rf mongo-replica-with-docker
# next we download our mongo-replica-set configuration
git clone https://github.com/Crizstian/mongo-replica-with-docker.git
echo '···························'
echo '·· setting up the mongodb cluster >>>> ··'
echo '···························'
# we go into the folder
cd mongo-replica-with-docker
# we create and init our mongodb replica set cluster
(bash < create-replica-set.sh)
# we go back to the root project
cd ..
}
function setup-images {
# go inside the docker folder again
cd _docker_setup
echo '···························'
echo '·· creating microservices images >>>> ··'
echo '···························'
# we start all our microservices
(bash < create-images.sh)
cd ..
}
function setup-services {
# go inside the docker folder again
cd _docker_setup
echo '···························'
echo '·· starting up the microservices >>>> ··'
echo '···························'
# we start all our microservices
(bash < start-services.sh)
cd ..
}
function status {
eval `docker-machine env manager1`
# we verify the docker swarm
docker node ls
# we verify our docker services
docker service ls
}
function main {
setup-swarm
setup-mongo
setup-images
setup-services
status
}
main