forked from shyim/shopware-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswdc
executable file
·65 lines (48 loc) · 1.3 KB
/
swdc
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
#!/usr/bin/env bash
export COMPOSE_PROJECT_NAME="shopware-docker"
export DOCKER_COMPOSE_FILE="/tmp/swdc-docker-compose.yml";
FILE="$0"
if [[ -L "$0" ]]; then
FILE="$(readlink ${0})"
fi
DIR="$(dirname ${FILE})"
export DIR="${DIR}"
export REALDIR=$(realpath ${DIR})
source "${DIR}/functions.sh"
if [[ ! -d "${HOME}/.config/swdc" ]]; then
mkdir -p "${HOME}/.config/swdc"
fi
if [[ -f "${HOME}/.swdc_env" ]]; then
mv "${HOME}/.swdc_env" "${HOME}/.config/swdc/env"
fi
if [[ ! -f "${HOME}/.config/swdc/env" ]]; then
cp "${DIR}/.env.dist" "${HOME}/.config/swdc/env"
fi
source "${DIR}/.env.dist"
source "${HOME}/.config/swdc/env"
source "${DIR}/docker.env"
if [[ ! -d "${HOME}/.config/swdc/ssl" ]]; then
mkdir -p "${HOME}/.config/swdc/ssl"
generate_wildcard_certs
fi
check_env_compability
SHOPWARE_PROJECT="$2"
SHOPWARE_FOLDER="${CODE_DIRECTORY}/$SHOPWARE_PROJECT"
# Need to be in docker folder for docker-compose
cd "${DIR}"
modules=(base)
if [[ -f "${CODE_DIRECTORY}/${2}/src/Kernel.php" ]]; then
modules=(base platform-local)
fi
if [[ "${1}" == "" ]];
then
source modules/base/command-list.sh
exit "1"
fi
for module in ${modules[@]}; do
if [[ -f "./modules/${module}/${1}.sh" ]]; then
source "./modules/${module}/${1}.sh"
exit 0
fi
done
compose exec cli bash /opt/swdc/swdc-inside "$@"