forked from Corentin-Luc-Artaud/credirama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare.sh
executable file
·74 lines (61 loc) · 1.7 KB
/
prepare.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
#!/usr/bin/env bash
# DELETE ALREADY EXISTING IMAGES
result=$( docker ps -a -q )
echo "Stopping and deleting containers"
if [[ -n "$result" ]]; then
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
else
echo "No such container"
fi
result=$( docker images -q analystservice:latest )
echo "Deleting analystservice:latest image"
if [[ -n "$result" ]]; then
docker rmi analystservice:latest
else
echo "No such container"
fi
result=$( docker images -q clientservice:latest )
echo "Deleting clientservice:latest image"
if [[ -n "$result" ]]; then
docker rmi clientservice:latest
else
echo "No such container"
fi
result=$( docker images -q timeservice:latest )
echo "Deleting timeservice:latest image"
if [[ -n "$result" ]]; then
docker rmi timeservice:latest
else
echo "No such container"
fi
if [ -d ./dumps ]; then
rm -r ./dumps
fi
cd ./models
echo "Building models"
mvn clean package install -DskipTests=true
cd ../generator
echo "Packaging generator"
mvn clean package install -DskipTests=true
cd ../clientService
echo "Building clientservice:latest image"
mvn clean package install -DskipTests=true
docker build -t clientservice:latest .
cd ../TimeService
echo "Building timeservice:latest image"
mvn clean package install -DskipTests=true
docker build -t timeservice:latest .
cd ../kafkaconnector
echo "Building kafkaconnector:latest image"
docker build -t kafkaconnector:latest .
cd ../analystservice
echo "Building analystservice:latest image"
mvn clean package -DskipTests=true
docker build -t analystservice:latest .
# RUN DOCKER-COMPOSE
cd ..
echo "Running Docker compose"
#docker-compose build --force-recreate
docker-compose up launch-barebone && docker-compose up launch-services
tput bel