Skip to content

Commit

Permalink
fixup:Ensure that all the output on bootstrap goes to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 5, 2023
1 parent 5e8c4b0 commit 1f49d65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/test_buildx_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@ jobs:
-e PHP_INI-upload_max_filesize=20M \
-e PHP_EXTENSION_xhprof=1 \
moodle-php-apache
docker exec test0 php /var/www/html/test.php
docker exec test0 php /var/www/html/check-ini.php
docker exec test0 php /var/www/html/check-entrypoint-scripts.php
curl --fail http://127.0.0.1:8000/test.php
curl --fail http://127.0.0.1:8000/check-ini.php
# 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
echo one
stdout=$(docker run --rm --name test1 moodle-php-apache 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)
echo four
[[ ${stdout} =~ "Checking for php configuration" ]] && echo "OK" || echo "Fail"
echo five
- name: Display container logs on failure
if: failure()
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f49d65

Please sign in to comment.