forked from shyim/shopware-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swdc-inside
executable file
·82 lines (62 loc) · 1.79 KB
/
swdc-inside
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
#!/usr/bin/env bash
if [[ -e /usr/local/bin/setup_nvm ]]; then
# shellcheck source=/dev/null
# shellcheck disable=SC2046
source /usr/local/bin/setup_nvm
fi
if [[ -z "$FILE" ]]; then
FILE="$0"
if [[ -L "$0" ]]; then
FILE=$(readlink "$0")
fi
DIR=$(dirname "${FILE}")
# shellcheck source=functions.sh
source "${DIR}/functions.sh"
fi
SHOPWARE_PROJECT="$2"
if [[ "$RUN_MODE" == "local" ]]; then
SHOPWARE_FOLDER="${CODE_DIRECTORY}/$SHOPWARE_PROJECT"
else
SHOPWARE_FOLDER="/var/www/html/$SHOPWARE_PROJECT"
CODE_DIRECTORY="/var/www/html"
fi
export SWDC_IN_DOCKER=1
modules=(base)
if [[ -n "$SHOPWARE_PROJECT" ]]; then
modules=(base classic)
if [[ -d "$SHOPWARE_FOLDER/app" ]]; then
modules=(base classic-composer classic)
fi
if [[ -f "$SHOPWARE_FOLDER/recovery/install/data/sql/install.sql" ]]; then
modules=(base classic-zip classic)
fi
if [[ -f "$SHOPWARE_FOLDER/src/Kernel.php" || -f "$SHOPWARE_FOLDER/src/Core/composer.json" || -f "$SHOPWARE_FOLDER/bin/build-js.sh" ]]; then
modules=(base platform)
fi
if [[ -f "$SHOPWARE_FOLDER/PLATFORM_COMMIT_SHA" ]]; then
modules=(base platform-prod platform)
fi
if [[ -f "$SHOPWARE_FOLDER/symfony.lock" ]]; then
modules=(base platform-prod platform)
fi
fi
# Need to be in docker folder for docker-compose
cd "${DIR}" || exit 1
for module in "${modules[@]}"; do
# shellcheck source=/dev/null
if [[ -f "./modules/${module}/${1}.sh" ]]; then
# shellcheck source=/dev/null
source "./modules/${module}/${1}.sh"
exit 0
fi
# shellcheck source=/dev/null
if [[ -f "/swdc-cfg/modules/${module}/${1}.sh" ]]; then
# shellcheck source=/dev/null
source "/swdc-cfg/modules/${module}/${1}.sh"
exit 0
fi
done
cat ./modules/base/header.txt
echo ""
echo ""
/opt/swdc/swdc-inside command-list