Repository navigation
Expand file tree
/
Copy pathdocker-compose
More file actions
executable file
·94 lines (85 loc) · 3.63 KB
/
Copy pathdocker-compose
File metadata and controls
executable file
·94 lines (85 loc) · 3.63 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env bash
# run docker-compose with the container specified by $FS_ENV and a suitable project name
# which command to run by docker-compose and additional arguments is specified by the arguments
# of this script
# Export the current host operating system to FS_PLATFORM
unameOut="$(uname -s)"
case "${unameOut}" in
Darwin*) export FS_PLATFORM=mac;;
*) export FS_PLATFORM=default;;
esac
dir=$(dirname "$0")
# shellcheck source=./__common.sh
source "$dir"/__common.sh
function _docker-compose () {
# Pick the first available compose implementation, so contributors are not forced to
# install Docker if they already use Podman (#2566). Order: Docker first (most common),
# then Podman. Detection is OS-independent (only checks command availability):
# - "docker compose": the Docker CLI compose plugin (replaces the old docker-compose).
# - docker-compose: the standalone Compose v1 binary, still present on older systems.
# - "podman compose": Podman's built-in compose wrapper (Podman 4.1+).
# - podman-compose: the standalone podman-compose tool.
if docker compose version >/dev/null 2>&1; then
docker compose "$@"
elif command -v docker-compose >/dev/null 2>&1; then
docker-compose "$@"
elif command -v podman-compose >/dev/null 2>&1; then
podman-compose "$@"
elif podman compose version >/dev/null 2>&1; then
podman compose "$@"
else
echo "No compose implementation found. Please install one of:" \
"'docker compose', docker-compose, 'podman compose', or podman-compose."
exit 1
fi
}
zammad_files=""
if [ "${ZAMMAD:-false}" = "true" ]; then
zammad_files="--file $dir/../docker/zammad/docker-compose.yml --env-file $dir/../docker/zammad/.env"
fi
listmonk_files=""
if [ "${LISTMONK:-false}" = "true" ]; then
listmonk_files="--file $dir/../docker/listmonk/docker-compose.yml"
fi
bluespice_files=""
if [ "${BLUESPICE:-false}" = "true" ]; then
bluespice_dir="$dir/../docker/bluespice"
source "$bluespice_dir/.env"
EXTENDED_TOOLS=""
if [[ "${EDITION}" == "pro" || "${EDITION}" == "farm" ]]; then
EXTENDED_TOOLS="${EXTENDED_TOOLS} -f $bluespice_dir/docker-compose.collabpads-service.yml"
WIKI_IMAGE=docker.bluespice.com/bluespice-${EDITION}/wiki:${VERSION}
if [[ $(docker images -q ${WIKI_IMAGE}) ]]; then
echo "Image ${WIKI_IMAGE} found locally."
elif [[ ! $(grep 'docker.bluespice.com' $HOME/.docker/config.json) ]]; then
echo "In order to access our ${EDITION}-Image please login to docker.bluespice.com"
docker login docker.bluespice.com
if [[ ! $(grep 'docker.bluespice.com' $HOME/.docker/config.json) ]]; then
echo -e "\n-------------\n"
echo "Please contact Tobias or Stefan for access"
echo -e "\n-------------\n"
exit
fi
fi
else
WIKI_IMAGE=bluespice/wiki:${VERSION}
fi
export BLUESPICE_SERVICE_REPOSITORY='bluespice'
export BLUESPICE_WIKI_IMAGE="${WIKI_IMAGE}"
export UPGRADE_ACTION="/app/bin/upgrade-pipeline"
bluespice_files="-f $bluespice_dir/docker-compose.main.yml \
-f $bluespice_dir/docker-compose.proxy.yml \
-f $bluespice_dir/docker-compose.helper-service.yml \
-f $bluespice_dir/docker-compose.persistent-data-services.yml \
-f $bluespice_dir/docker-compose.stateless-services.yml \
${EXTENDED_TOOLS} \
--env-file $bluespice_dir/.env"
fi
_docker-compose \
--file "$dir"/../docker/docker-compose.yml \
--file "$dir"/../docker/docker-compose."$FS_ENV".yml \
$zammad_files \
$listmonk_files \
$bluespice_files \
--project-name foodsharing_"$FS_ENV" \
"$@"