Skip to content

Commit 2fff4e5

Browse files
committed
Fixed instance-debug in docker [skip ci]
1 parent 99705aa commit 2fff4e5

File tree

3 files changed

+34
-22
lines changed

3 files changed

+34
-22
lines changed

docker-dev.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ zope-conf-additional =
6363
password ${port:admin-password}
6464
</clock-server>
6565
${zope-conf:zamqp}
66+
67+
[instance-debug]
68+
blob-storage = /data/blobstorage

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ services:
212212
# unless-stopped
213213
maintenance:
214214
image: imiobe/iadelib:latest
215-
entrypoint: bash
215+
command: maintenance
216216
ports:
217217
- "20089:8080"
218218
networks:

docker/docker-entrypoint.sh

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
11
#!/bin/bash
22
set -e
33

4-
PRIORIY="instance-cron zeoserver"
5-
CURL="curl --write-out '%{http_code}' -so /dev/null worker-cron:8087/standard/@@ok"
4+
function setup() {
5+
mkdir -pvm 777 /data/{log,filestorage,blobstorage}
6+
python docker-initialize.py
67

7-
mkdir -p -m 777 /data/{log,filestorage,blobstorage}
8-
python docker-initialize.py
8+
if [[ $MOUNTPOINT ]]; then
9+
mkdir -pvm 777 "/data/blobstorage-$MOUNTPOINT"
10+
fi
911

10-
if [[ $MOUNTPOINT ]]
11-
then
12-
mkdir -p -m 777 "/data/blobstorage-$MOUNTPOINT"
13-
fi
14-
15-
if [[ "instance" == "$1" || ! $PRIORIY == *"$1"* ]]
16-
then
12+
if [[ "instance-cron" == "$1" ]]; then
13+
echo "Setting ACTIVE_BIGBANG"
14+
export ACTIVE_BIGBANG="True"
15+
fi
16+
}
17+
function wait_for_cron() {
18+
CURL="curl --write-out '%{http_code}' -so /dev/null worker-cron:8087/standard/@@ok"
1719
echo "Waiting instance-cron ..."
1820
sleep 20
1921
response=$($CURL)
2022
echo "received response $response"
21-
while [[ "$response" != "'200'" ]]
22-
do
23+
while [[ "$response" != "'200'" ]]; do
2324
echo "Waiting instance-cron ..."
2425
sleep 10
2526
response=$($CURL)
2627
echo "received response $response"
2728
done
28-
fi
29+
}
2930

30-
if [[ "instance-cron" == "$1" ]]
31-
then
32-
echo "Setting ACTIVE_BIGBANG"
33-
export ACTIVE_BIGBANG="True"
34-
fi
3531

36-
echo "Starting $1"
37-
exec "bin/python" "bin/$1" "fg"
32+
setup "$1"
33+
34+
PRIORIY="instance-cron instance-debug maintenance zeoserver"
35+
if [[ "instance" == "$1" || ! $PRIORIY == *"$1"* ]]; then
36+
wait_for_cron "$1"
37+
fi
3838

39+
case "$1" in
40+
"maintenance")
41+
exec "bash"
42+
;;
43+
*)
44+
echo "Starting $1"
45+
exec "bin/python" "bin/$1" "fg"
46+
;;
47+
esac

0 commit comments

Comments
 (0)