From 286bfc7f1cf25d092aa2c2b3e82b3eef09f201bf Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 5 Oct 2023 11:52:22 +0200 Subject: [PATCH] fixup:Ensure that all the output on bootstrap goes to stderr --- .github/workflows/test_buildx_and_publish.yml | 13 ++++++++++--- Dockerfile | 5 ----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_buildx_and_publish.yml b/.github/workflows/test_buildx_and_publish.yml index dfa77fb..b26709f 100644 --- a/.github/workflows/test_buildx_and_publish.yml +++ b/.github/workflows/test_buildx_and_publish.yml @@ -20,14 +20,21 @@ jobs: - name: Run tests run: | + set -x + set +e + # Verify that CLI execution only includes the expected output (if we discard stderr). echo zero - docker run --rm --name test1 moodle-php-apache php /var/www/html/check-stderr.php 2>/dev/null + docker run --rm --name test1 moodlehq/moodle-php-apache:dev php /var/www/html/check-stderr.php 2>/dev/null echo one - stdout=$(docker run --rm --name test1 moodle-php-apache php /var/www/html/check-stderr.php 2>/dev/null) + stdout=$(docker run --rm --name test1 moodlehq/moodle-php-apache:dev php /var/www/html/check-stderr.php 2>/dev/null) + echo two [[ ${stdout} == "Hello World!" ]] && echo "OK" || echo "Fail" + echo three # Verify that stderr still contains information about the bootstrap. - stdout=$(docker run --rm --name test1 moodle-php-apache php /var/www/html/check-stderr.php 2>&1) + stdout=$(docker run --rm --name test1 moodlehq/moodle-php-apache:dev php /var/www/html/check-stderr.php 2>&1) + echo four [[ ${stdout} =~ "Checking for php configuration" ]] && echo "OK" || echo "Fail" + echo five - name: Display container logs on failure if: failure() diff --git a/Dockerfile b/Dockerfile index cd3d71a..cdd1e2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,11 +24,6 @@ RUN apt-get update && apt-get install -y \ # For an example of php80-rc5 near complete, using pickle instead of pear/pecl, look to: # https://github.com/stronk7/moodle-php-apache/tree/8.0-buster-pickle-version -# Generate all the UTF-8 locales. -ARG DEBIAN_FRONTEND=noninteractive -ADD root/tmp/setup/locales-gen.sh /tmp/setup/locales-gen.sh -RUN /tmp/setup/locales-gen.sh - # Setup the required extensions. ADD root/tmp/setup/php-extensions.sh /tmp/setup/php-extensions.sh RUN /tmp/setup/php-extensions.sh