mirror of
https://github.com/cytopia/devilbox.git
synced 2024-12-19 12:57:52 +00:00
Test startup files
This commit is contained in:
parent
ddbe0f9bb6
commit
cb7ec86765
@ -144,7 +144,8 @@ info:
|
||||
###
|
||||
### Run tests
|
||||
###
|
||||
test: test-vhost test-intra
|
||||
test: test-vhost test-intra test-startup
|
||||
|
||||
|
||||
test-intra:
|
||||
@echo "####################################################################################################"
|
||||
@ -278,6 +279,16 @@ test-vhost:
|
||||
@echo
|
||||
|
||||
|
||||
test-startup:
|
||||
@echo "####################################################################################################"
|
||||
@echo "# RUNNING TESTS: STARTUP"
|
||||
@echo "####################################################################################################"
|
||||
@echo
|
||||
@if ! $(CURRENT_PATH)startup-tests/startup.sh; then \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Helper Targets
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
38
.tests/startup-tests/startup.sh
Executable file
38
.tests/startup-tests/startup.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/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.d/*.sh-example -type f -print0 2>/dev/null" \
|
||||
| xargs -0 -n 1 echo \
|
||||
| while read f; do
|
||||
|
||||
echo "# ----------------------------------------------------------------------------------------"
|
||||
echo "# [TEST] ${f}"
|
||||
echo "# ----------------------------------------------------------------------------------------"
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}"; then
|
||||
sleep 5
|
||||
if ! docker exec -t ${CONTAINER} bash "${f}"; then
|
||||
echo "[FAIl] ${f}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "[OK] ${f}"
|
||||
echo
|
||||
echo
|
||||
done
|
Loading…
Reference in New Issue
Block a user