Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions php/php73/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php74/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php80/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php81/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php82/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php83/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php84/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
4 changes: 4 additions & 0 deletions php/php85/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ RUN echo 'setopt +o nomatch' > ~/.zshrc
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
RUN cat ~/.bashrc >> ~/.zshrc

COPY smoke-test.sh /usr/local/bin/totara-php-smoke-test
RUN chmod +x /usr/local/bin/totara-php-smoke-test \
&& /usr/local/bin/totara-php-smoke-test

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
50 changes: 50 additions & 0 deletions php/smoke-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh
set -eu

check_php_extension() {
extension="$1"
if ! php -r "exit(extension_loaded('$extension') ? 0 : 1);"; then
echo "Missing PHP extension: ${extension}" >&2
exit 1
fi
}

check_locale() {
locale_name="$1"
if ! locale -a | grep -qi "^${locale_name}[.].*utf"; then
echo "Missing locale: ${locale_name}.UTF-8" >&2
exit 1
fi
}

php -v >/dev/null
composer --version >/dev/null
php-fpm -t

for extension in \
gd \
igbinary \
intl \
ldap \
memcached \
mysqli \
pcov \
pdo_mysql \
pdo_pgsql \
pgsql \
redis \
soap \
xdebug \
xhprof \
zip
do
check_php_extension "$extension"
done

if ! php -r 'exit(PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION === 5 ? 0 : 1);'; then
check_php_extension sqlsrv
check_php_extension pdo_sqlsrv
fi

check_locale en_US
check_locale en_AU