Maurits van der Schee 4 years ago
parent
commit
f96625b0f9
3 changed files with 34 additions and 27 deletions
  1. 6
    6
      README.md
  2. 9
    1
      docker/centos8/Dockerfile
  3. 19
    20
      docker/centos8/run.sh

+ 6
- 6
README.md View File

@@ -1096,9 +1096,9 @@ I am testing mainly on Ubuntu and I have the following test setups:
1096 1096
   - (Docker) Ubuntu 16.04 with PHP 7.0, MariaDB 10.0, PostgreSQL 9.5 (PostGIS 2.2) and SQL Server 2017
1097 1097
   - (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3) and SQLite 3.16
1098 1098
   - (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
1100 1100
   - (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
1102 1102
 
1103 1103
 This covers not all environments (yet), so please notify me of failing tests and report your environment. 
1104 1104
 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
1155 1155
     CentOS 8 (PHP 7.2)
1156 1156
     ================================================
1157 1157
     [1/4] Starting MariaDB 10.3 ..... done
1158
-    [2/4] Starting PostgreSQL 10.6 .. skipped
1158
+    [2/4] Starting PostgreSQL 12.2 .. done
1159 1159
     [3/4] Starting SQLServer 2017 ... skipped
1160 1160
     [4/4] Cloning PHP-CRUD-API v2 ... skipped
1161 1161
     ------------------------------------------------
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
1164 1164
     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
1166 1166
     ================================================
1167 1167
     Debian 10 (PHP 7.3)
1168 1168
     ================================================

+ 9
- 1
docker/centos8/Dockerfile View File

@@ -1,12 +1,20 @@
1 1
 FROM centos:8
2 2
 
3
+# add this to avoid locale warnings
3 4
 RUN yum -y install glibc-locale-source glibc-langpack-en
4 5
 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
5 13
 
6 14
 RUN yum -y install \
7 15
 php-cli php-xml \
8 16
 mariadb-server mariadb php-mysqlnd php-json \
9
-#postgresql-server postgresql php-pgsql \
17
+postgresql12 postgresql12-server php-pgsql postgis30_12 \
10 18
 sqlite php-sqlite3 \
11 19
 git wget
12 20
 

+ 19
- 20
docker/centos8/run.sh View File

@@ -21,26 +21,25 @@ FLUSH PRIVILEGES;
21 21
 EOF
22 22
 echo "done"
23 23
 
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"
44 43
 
45 44
 echo -n "[3/4] Starting SQLServer 2017 ... "
46 45
 echo "skipped"

Loading…
Cancel
Save