Skip to content

Commit

Permalink
Use a separate container for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sibprogrammer committed Aug 5, 2024
1 parent 7b0e9fc commit 81d233c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 13 additions & 3 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 1999-2024. WebPros International GmbH.
services:
tests:
plesk:
build:
context: ../latest/
args:
Expand All @@ -15,6 +15,16 @@ services:
- /run/lock
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup
- .:/opt/tests/
cgroup: host
command: /opt/tests/wait-for-plesk.sh
tests:
image: debian:bookworm
depends_on:
- plesk
links:
- plesk
volumes:
- .:/opt/tests/
command: >
bash -c "apt-get update
&& apt-get install -y curl
&& /opt/tests/wait-for-plesk.sh"
7 changes: 5 additions & 2 deletions tests/wait-for-plesk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
COUNTER=1

while : ; do
curl -ksL https://localhost:8443/ | grep "<title>Plesk" > /dev/null
[ $? -eq 0 ] && exit 0
curl -ksL https://plesk:8443/ | grep "<title>Plesk" > /dev/null
if [ $? -eq 0 ]; then
echo "Plesk was successfully initialized."
exit 0
fi
echo "($COUNTER) Waiting for the Plesk initialization..."
sleep 5
COUNTER=$((COUNTER + 1))
Expand Down

0 comments on commit 81d233c

Please sign in to comment.