1
|
#!/bin/bash
|
2
|
|
3
|
FILE=docker-compose.yml
|
4
|
|
5
|
if [ -f "$FILE" ]; then
|
6
|
echo "$FILE exist"
|
7
|
else
|
8
|
echo "$FILE does not exist"
|
9
|
exit
|
10
|
fi
|
11
|
|
12
|
echo "---CREATING FAKE DIRS---"
|
13
|
mkdir be
|
14
|
mkdir ./be/fulltextsearch
|
15
|
mkdir fe
|
16
|
mkdir ./fe/fulltextsearch
|
17
|
|
18
|
echo "---DELETING ALL IMAGES---"
|
19
|
docker image rm -f $(docker image ls -aq)
|
20
|
|
21
|
echo "---PULLING FULL TEXT SEARCH FROM DOCKER HUB---"
|
22
|
docker-compose pull
|
23
|
|
24
|
echo "---STOPPING ALL RUNNING CONTAINERS---"
|
25
|
docker container stop $(docker container ls -aq)
|
26
|
|
27
|
echo "---DELETING ALL RUNNING CONTAINERS---"
|
28
|
docker container rm $(docker container ls -aq)
|
29
|
|
30
|
echo "---STARTING CONTAINERS---"
|
31
|
docker-compose up -d --no-build
|
32
|
|
33
|
echo "---DELETING CORE WITH NAME 'files'---"
|
34
|
docker exec fulltextsearch-solr solr delete -c files
|
35
|
|
36
|
echo "---DELETING CORE WITH NAME 'documents'---"
|
37
|
docker exec fulltextsearch-solr solr delete -c documents
|
38
|
|
39
|
echo "---CREATING CORE WITH NAME 'documents'---"
|
40
|
docker exec fulltextsearch-solr solr create -c documents
|
41
|
|
42
|
echo "---CREATING CORE WITH NAME 'files'---"
|
43
|
docker exec fulltextsearch-solr solr create -c files
|
44
|
|
45
|
echo "---DELETING FAKE DIRS---"
|
46
|
cd be
|
47
|
rmdir fulltextsearch
|
48
|
cd ..
|
49
|
rmdir be
|
50
|
cd fe
|
51
|
rmdir fulltextsearch
|
52
|
cd ..
|
53
|
rmdir fe
|
54
|
|
55
|
echo "---SUCCESSFULLY FINISHED---"
|
56
|
echo "---APP STARTED ON localhost:4200---"
|