devilbox/.tests/startup-tests/startup.1.sh

39 lines
1.1 KiB
Bash
Raw Normal View History

2018-12-27 12:16:30 +00:00
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
COMPOSEPATH="${SCRIPTPATH}/../../"
CONTAINER="$( cd "${COMPOSEPATH}" && docker-compose ps -q php )"
#FILES="$()"
cd "${COMPOSEPATH}" && docker-compose exec -T php bash -c "find /startup.1.d/*.sh-example -type f -print0 2>/dev/null" \
2018-12-27 12:16:30 +00:00
| xargs -0 -n 1 echo \
| while read f; do
echo "# ----------------------------------------------------------------------------------------"
echo "# [TEST] ${f}"
echo "# ----------------------------------------------------------------------------------------"
2018-12-27 12:46:31 +00:00
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
2018-12-27 12:16:30 +00:00
sleep 5
2018-12-27 12:46:31 +00:00
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
2018-12-27 12:16:30 +00:00
sleep 5
2018-12-27 12:46:31 +00:00
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
2018-12-27 12:16:30 +00:00
sleep 5
2018-12-27 12:46:31 +00:00
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
2018-12-27 12:16:30 +00:00
sleep 5
2018-12-27 12:46:31 +00:00
if ! docker exec -t ${CONTAINER} bash "${f}" "ACCEPT_EULA=1"; then
2018-12-27 12:16:30 +00:00
echo "[FAIl] ${f}"
exit 1
fi
fi
fi
fi
fi
echo "[OK] ${f}"
echo
echo
done