mirror of
https://github.com/devilbox/docker-php-fpm.git
synced 2025-12-10 11:01:14 +00:00
50 lines
942 B
Bash
Executable File
50 lines
942 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
set -u
|
|
set -o pipefail
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)"
|
|
|
|
IMAGE="${1}"
|
|
ARCH="${2}"
|
|
VERSION="${3}"
|
|
FLAVOUR="${4}"
|
|
TAG="${5}"
|
|
|
|
# shellcheck disable=SC1090
|
|
. "${CWD}/../.lib.sh"
|
|
|
|
|
|
|
|
############################################################
|
|
# Tests
|
|
############################################################
|
|
|
|
###
|
|
### Ensuring 'apt update' works without any issues
|
|
###
|
|
print_h2 "Ensure 'apt update' works"
|
|
if ! name="$( docker_run "${IMAGE}:${TAG}" "${ARCH}" "-e DEBUG_ENTRYPOINT=2" )"; then
|
|
exit 1
|
|
fi
|
|
|
|
# Check if PHP-FPM is running
|
|
print_h2 "Check if PHP-FPM is running"
|
|
if ! check_php_fpm_running "${name}"; then
|
|
docker_logs "${name}" || true
|
|
docker_stop "${name}" || true
|
|
echo "Failed"
|
|
exit 1
|
|
fi
|
|
|
|
# Start Tests
|
|
print_h2 "Testing..."
|
|
if ! docker_exec "${name}" "apt update"; then
|
|
docker_logs "${name}" || true
|
|
docker_stop "${name}" || true
|
|
echo "Failed"
|
|
exit 1
|
|
fi
|
|
docker_stop "${name}"
|