From 81d233c447497dd0475bb445a53fd0ecc7912340 Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov Date: Mon, 5 Aug 2024 21:15:06 +0100 Subject: [PATCH] Use a separate container for tests --- tests/docker-compose.yml | 16 +++++++++++++--- tests/wait-for-plesk.sh | 7 +++++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index fb22198..8700d7a 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,6 +1,6 @@ # Copyright 1999-2024. WebPros International GmbH. services: - tests: + plesk: build: context: ../latest/ args: @@ -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" diff --git a/tests/wait-for-plesk.sh b/tests/wait-for-plesk.sh index 38c73c6..d377870 100755 --- a/tests/wait-for-plesk.sh +++ b/tests/wait-for-plesk.sh @@ -4,8 +4,11 @@ COUNTER=1 while : ; do - curl -ksL https://localhost:8443/ | grep "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))