-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
meilisearch.pre-install
executable file
·42 lines (34 loc) · 1.05 KB
/
meilisearch.pre-install
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
#!/usr/bin/env bash
# Check Docksal running
if [[ "$DOCKER_RUNNING" != "true" ]]; then
echo "[PRE-INSTALL] ERROR: Docksal and project should be running"
exit 1
fi
# Check Docksal running
if [[ "$ADDON_GLOBAL" == "true" ]]; then
echo -e "[PRE-INSTALL] ERROR: Meilisearch addon should not be installed globally"
exit 1
fi
# Check project running
if ! (fin ps | grep "_cli_" | grep "Up" >/dev/null); then
echo "[PRE-INSTALL] ERROR: Start the project with fin start first"
exit 1
fi
# Get fin config
fin_config=$(fin config)
if [[ $? != 0 ]]; then
echo "[PRE-INSTALL] ERROR: 'fin config' command was not successful. Check your fin config"
exit 1
fi
# Check there is no adminer already
if (echo "$fin_config" | grep "image: getmeili/meilisearch"); then
echo "[PRE-INSTALL] ERROR: Adminer seems to be already enabled for this project"
exit 1
fi
# Check there is no adminer already
if (echo "$fin_config" | grep " meilisearch:"); then
echo "[PRE-INSTALL] ERROR: Container named 'meilisearch' already exists. Remove it to continue."
exit 1
fi
# All good
exit 0