diff --git a/README.md b/README.md index fd7e73a..348b7e4 100644 --- a/README.md +++ b/README.md @@ -1096,9 +1096,9 @@ I am testing mainly on Ubuntu and I have the following test setups: - (Docker) Ubuntu 16.04 with PHP 7.0, MariaDB 10.0, PostgreSQL 9.5 (PostGIS 2.2) and SQL Server 2017 - (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3) and SQLite 3.16 - (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22 - - (Docker) CentOS 8 with PHP 7.2, MariaDB 10.3, ~~PostgreSQL 10.6 (PostGIS 2.4)~~ and SQLite 3.26 + - (Docker) CentOS 8 with PHP 7.2, MariaDB 10.3, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.26 - (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5) and SQLite 3.27 - - (Docker) Ubuntu 20.04 with PHP 7.3, MySQL 8.0, PostgreSQL 12 (PostGIS 3) and SQLite 3.31 + - (Docker) Ubuntu 20.04 with PHP 7.3, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.31 This covers not all environments (yet), so please notify me of failing tests and report your environment. I will try to cover most relevant setups in the "docker" folder of the project. @@ -1155,14 +1155,14 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire CentOS 8 (PHP 7.2) ================================================ [1/4] Starting MariaDB 10.3 ..... done - [2/4] Starting PostgreSQL 10.6 .. skipped + [2/4] Starting PostgreSQL 12.2 .. done [3/4] Starting SQLServer 2017 ... skipped [4/4] Cloning PHP-CRUD-API v2 ... skipped ------------------------------------------------ - mysql: 102 tests ran in 2712 ms, 0 skipped, 0 failed - pgsql: skipped, driver not loaded + mysql: 102 tests ran in 2906 ms, 0 skipped, 0 failed + pgsql: 102 tests ran in 795 ms, 0 skipped, 0 failed sqlsrv: skipped, driver not loaded - sqlite: 102 tests ran in 1162 ms, 11 skipped, 0 failed + sqlite: 102 tests ran in 811 ms, 11 skipped, 0 failed ================================================ Debian 10 (PHP 7.3) ================================================ diff --git a/docker/centos8/Dockerfile b/docker/centos8/Dockerfile index 9a835ab..2faf748 100644 --- a/docker/centos8/Dockerfile +++ b/docker/centos8/Dockerfile @@ -1,12 +1,20 @@ FROM centos:8 +# add this to avoid locale warnings RUN yum -y install glibc-locale-source glibc-langpack-en RUN localedef -i en_US -f UTF-8 en_US.UTF-8 +# enable the postgresql repo +RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm +# enable epel and powertools repos +RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled PowerTools +# disable postgresql appstream repo +RUN dnf -y module disable postgresql RUN yum -y install \ php-cli php-xml \ mariadb-server mariadb php-mysqlnd php-json \ -#postgresql-server postgresql php-pgsql \ +postgresql12 postgresql12-server php-pgsql postgis30_12 \ sqlite php-sqlite3 \ git wget diff --git a/docker/centos8/run.sh b/docker/centos8/run.sh index fadcf42..888e00b 100755 --- a/docker/centos8/run.sh +++ b/docker/centos8/run.sh @@ -21,26 +21,25 @@ FLUSH PRIVILEGES; EOF echo "done" -echo -n "[2/4] Starting PostgreSQL 10.6 .. " -# # initialize postgresql -# su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null -# # run postgres server -# nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 & -# # wait for postgres to become available -# until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do -# sleep 1; -# done -# # create database and user on postgres -# su - -c "psql -U postgres >/dev/null" postgres << 'EOF' -# CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api'; -# CREATE DATABASE "php-crud-api"; -# GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api"; -# \c "php-crud-api"; -# CREATE EXTENSION IF NOT EXISTS postgis; -# \q -# EOF -# echo "done" -echo "skipped" +echo -n "[2/4] Starting PostgreSQL 12.2 .. " +# initialize postgresql +su - -c "/usr/pgsql-12/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null +# run postgres server +nohup su - -c "/usr/pgsql-12/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 & +# wait for postgres to become available +until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do + sleep 1; +done +# create database and user on postgres +su - -c "psql -U postgres >/dev/null" postgres << 'EOF' +CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api'; +CREATE DATABASE "php-crud-api"; +GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api"; +\c "php-crud-api"; +CREATE EXTENSION IF NOT EXISTS postgis; +\q +EOF +echo "done" echo -n "[3/4] Starting SQLServer 2017 ... " echo "skipped"