Skip to content

Commit f96625b

Browse files
committed
Fix for #644
1 parent b0606ed commit f96625b

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,9 +1096,9 @@ I am testing mainly on Ubuntu and I have the following test setups:
10961096
- (Docker) Ubuntu 16.04 with PHP 7.0, MariaDB 10.0, PostgreSQL 9.5 (PostGIS 2.2) and SQL Server 2017
10971097
- (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3) and SQLite 3.16
10981098
- (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22
1099-
- (Docker) CentOS 8 with PHP 7.2, MariaDB 10.3, ~~PostgreSQL 10.6 (PostGIS 2.4)~~ and SQLite 3.26
1099+
- (Docker) CentOS 8 with PHP 7.2, MariaDB 10.3, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.26
11001100
- (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5) and SQLite 3.27
1101-
- (Docker) Ubuntu 20.04 with PHP 7.3, MySQL 8.0, PostgreSQL 12 (PostGIS 3) and SQLite 3.31
1101+
- (Docker) Ubuntu 20.04 with PHP 7.3, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.31
11021102

11031103
This covers not all environments (yet), so please notify me of failing tests and report your environment.
11041104
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
11551155
CentOS 8 (PHP 7.2)
11561156
================================================
11571157
[1/4] Starting MariaDB 10.3 ..... done
1158-
[2/4] Starting PostgreSQL 10.6 .. skipped
1158+
[2/4] Starting PostgreSQL 12.2 .. done
11591159
[3/4] Starting SQLServer 2017 ... skipped
11601160
[4/4] Cloning PHP-CRUD-API v2 ... skipped
11611161
------------------------------------------------
1162-
mysql: 102 tests ran in 2712 ms, 0 skipped, 0 failed
1163-
pgsql: skipped, driver not loaded
1162+
mysql: 102 tests ran in 2906 ms, 0 skipped, 0 failed
1163+
pgsql: 102 tests ran in 795 ms, 0 skipped, 0 failed
11641164
sqlsrv: skipped, driver not loaded
1165-
sqlite: 102 tests ran in 1162 ms, 11 skipped, 0 failed
1165+
sqlite: 102 tests ran in 811 ms, 11 skipped, 0 failed
11661166
================================================
11671167
Debian 10 (PHP 7.3)
11681168
================================================

docker/centos8/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
FROM centos:8
22

3+
# add this to avoid locale warnings
34
RUN yum -y install glibc-locale-source glibc-langpack-en
45
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
6+
# enable the postgresql repo
7+
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
8+
# enable epel and powertools repos
9+
RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
10+
RUN dnf -y install 'dnf-command(config-manager)' && dnf -y config-manager --set-enabled PowerTools
11+
# disable postgresql appstream repo
12+
RUN dnf -y module disable postgresql
513

614
RUN yum -y install \
715
php-cli php-xml \
816
mariadb-server mariadb php-mysqlnd php-json \
9-
#postgresql-server postgresql php-pgsql \
17+
postgresql12 postgresql12-server php-pgsql postgis30_12 \
1018
sqlite php-sqlite3 \
1119
git wget
1220

docker/centos8/run.sh

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,25 @@ FLUSH PRIVILEGES;
2121
EOF
2222
echo "done"
2323

24-
echo -n "[2/4] Starting PostgreSQL 10.6 .. "
25-
# # initialize postgresql
26-
# su - -c "/usr/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
27-
# # run postgres server
28-
# nohup su - -c "/usr/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
29-
# # wait for postgres to become available
30-
# until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
31-
# sleep 1;
32-
# done
33-
# # create database and user on postgres
34-
# su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
35-
# CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
36-
# CREATE DATABASE "php-crud-api";
37-
# GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
38-
# \c "php-crud-api";
39-
# CREATE EXTENSION IF NOT EXISTS postgis;
40-
# \q
41-
# EOF
42-
# echo "done"
43-
echo "skipped"
24+
echo -n "[2/4] Starting PostgreSQL 12.2 .. "
25+
# initialize postgresql
26+
su - -c "/usr/pgsql-12/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
27+
# run postgres server
28+
nohup su - -c "/usr/pgsql-12/bin/postgres -D /var/lib/pgsql/data" postgres > /root/postgres.log 2>&1 &
29+
# wait for postgres to become available
30+
until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
31+
sleep 1;
32+
done
33+
# create database and user on postgres
34+
su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
35+
CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
36+
CREATE DATABASE "php-crud-api";
37+
GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
38+
\c "php-crud-api";
39+
CREATE EXTENSION IF NOT EXISTS postgis;
40+
\q
41+
EOF
42+
echo "done"
4443

4544
echo -n "[3/4] Starting SQLServer 2017 ... "
4645
echo "skipped"

0 commit comments

Comments
 (0)