From c358e6aaf65e3bbc926fbb1e61ec242dee9e1e5c Mon Sep 17 00:00:00 2001 From: Alexei Yuzhakov Date: Sat, 29 Jun 2019 23:00:25 +0700 Subject: [PATCH] Wait for Plesk initialization before tests execution --- docker-compose.yml | 2 +- wait-for-plesk.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 wait-for-plesk.sh diff --git a/docker-compose.yml b/docker-compose.yml index 3770f366..5a461f79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: environment: REMOTE_URL: https://plesk:8443 REMOTE_PASSWORD: changeme - command: bash -c "cd /opt/api-php-lib && composer install && composer test -- --testdox" + command: bash -c "cd /opt/api-php-lib && composer install && ./wait-for-plesk.sh && composer test -- --testdox" depends_on: - plesk links: diff --git a/wait-for-plesk.sh b/wait-for-plesk.sh new file mode 100755 index 00000000..2a30fc3f --- /dev/null +++ b/wait-for-plesk.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +while : ; do + curl -ks https://plesk:8443/ | grep "Plesk" > /dev/null + [ $? -eq 0 ] && break + sleep 5 +done