mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-02 00:54:54 +02:00
Move common functions into common.bash
This commit is contained in:
parent
53b930448d
commit
05deaa3196
2 changed files with 19 additions and 22 deletions
|
@ -158,4 +158,22 @@ function duplicate_config_for_container() {
|
|||
mkdir -p "$output"
|
||||
cp -r "$PWD/test/config/${1:?}/." "$output"
|
||||
echo "$output"
|
||||
}
|
||||
}
|
||||
|
||||
function container_has_service_running() {
|
||||
containerName="$1"
|
||||
serviceName="$2"
|
||||
docker exec "$containerName" /usr/bin/supervisorctl status "$serviceName" | grep RUNNING >/dev/null
|
||||
}
|
||||
|
||||
function wait_for_service() {
|
||||
containerName="$1"
|
||||
serviceName="$2"
|
||||
repeat_in_container_until_success_or_timeout 600 "$containerName" \
|
||||
container_has_service_running "$containerName" "$serviceName"
|
||||
}
|
||||
|
||||
function count_processed_changes() {
|
||||
containerName=$1
|
||||
docker exec "$containerName" cat /var/log/supervisor/changedetector.log | grep "Change detected" -c
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue