Skip to content

Commit b2e1be4

Browse files
committed
Add debian 11
1 parent df23f92 commit b2e1be4

File tree

4 files changed

+92
-5
lines changed

4 files changed

+92
-5
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,8 @@ I am testing mainly on Ubuntu and I have the following test setups:
13721372
- (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22
13731373
- (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5) and SQLite 3.27
13741374
- (Docker) Ubuntu 20.04 with PHP 7.4, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.31
1375-
- (Docker) CentOS 8 with PHP 8.0, MariaDB 10.5, PostgreSQL 12.5 (PostGIS 3.0) and SQLite 3.26
1375+
- (Docker) CentOS 8 with PHP 8.0, MariaDB 10.6, PostgreSQL 12.8 (PostGIS 3.0) and SQLite 3.26
1376+
- (Docker) Debian 11 with PHP 7.4, MariaDB 10.5, PostgreSQL 13.4 (PostGIS 3.1) and SQLite 3.34
13761377

13771378
This covers not all environments (yet), so please notify me of failing tests and report your environment.
13781379
I will try to cover most relevant setups in the "docker" folder of the project.
@@ -1429,8 +1430,8 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
14291430
================================================
14301431
CentOS 8 (PHP 8.0)
14311432
================================================
1432-
[1/4] Starting MariaDB 10.5 ..... done
1433-
[2/4] Starting PostgreSQL 12.5 .. done
1433+
[1/4] Starting MariaDB 10.6 ..... done
1434+
[2/4] Starting PostgreSQL 12.8 .. done
14341435
[3/4] Starting SQLServer 2017 ... skipped
14351436
[4/4] Cloning PHP-CRUD-API v2 ... skipped
14361437
------------------------------------------------
@@ -1450,6 +1451,18 @@ To run the docker tests run "build_all.sh" and "run_all.sh" from the docker dire
14501451
pgsql: 110 tests ran in 816 ms, 1 skipped, 0 failed
14511452
sqlsrv: skipped, driver not loaded
14521453
sqlite: 110 tests ran in 690 ms, 12 skipped, 0 failed
1454+
================================================
1455+
Debian 11 (PHP 7.3)
1456+
================================================
1457+
[1/4] Starting MariaDB 10.5 ..... done
1458+
[2/4] Starting PostgreSQL 13.4 .. done
1459+
[3/4] Starting SQLServer 2017 ... skipped
1460+
[4/4] Cloning PHP-CRUD-API v2 ... skipped
1461+
------------------------------------------------
1462+
mysql: 110 tests ran in 1236 ms, 1 skipped, 0 failed
1463+
pgsql: 110 tests ran in 1291 ms, 1 skipped, 0 failed
1464+
sqlsrv: skipped, driver not loaded
1465+
sqlite: 110 tests ran in 938 ms, 13 skipped, 0 failed
14531466
================================================
14541467
Debian 9 (PHP 7.0)
14551468
================================================

docker/centos8/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
echo "================================================"
33
echo " CentOS 8 (PHP 8.0)"
44
echo "================================================"
5-
echo -n "[1/4] Starting MariaDB 10.5 ..... "
5+
echo -n "[1/4] Starting MariaDB 10.6 ..... "
66
# initialize mysql
77
mysql_install_db > /dev/null
88
chown -R mysql:mysql /var/lib/mysql
@@ -21,7 +21,7 @@ FLUSH PRIVILEGES;
2121
EOF
2222
echo "done"
2323

24-
echo -n "[2/4] Starting PostgreSQL 12.5 .. "
24+
echo -n "[2/4] Starting PostgreSQL 12.8 .. "
2525
# initialize postgresql
2626
su - -c "/usr/pgsql-12/bin/initdb --auth-local peer --auth-host password -D /var/lib/pgsql/data" postgres > /dev/null
2727
# run postgres server

docker/debian11/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM debian:11
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
# install: php / mysql / postgres / sqlite / tools / mssql deps
6+
RUN apt-get update && apt-get -y install \
7+
php-cli php-xml php-mbstring \
8+
mariadb-server mariadb-client php-mysql \
9+
postgresql php-pgsql \
10+
postgresql-13-postgis-3 \
11+
sqlite3 php-sqlite3 \
12+
git wget
13+
14+
# install run script
15+
ADD run.sh /usr/sbin/docker-run
16+
CMD docker-run

docker/debian11/run.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
echo "================================================"
3+
echo " Debian 11 (PHP 7.4)"
4+
echo "================================================"
5+
6+
echo -n "[1/4] Starting MariaDB 10.5 ..... "
7+
# make sure mysql can create socket and lock
8+
mkdir /var/run/mysqld && chmod 777 /var/run/mysqld
9+
# run mysql server
10+
nohup mysqld > /root/mysql.log 2>&1 &
11+
# wait for mysql to become available
12+
while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
13+
sleep 1
14+
done
15+
# create database and user on mysql
16+
mysql -u root >/dev/null << 'EOF'
17+
CREATE DATABASE `php-crud-api` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
18+
CREATE USER 'php-crud-api'@'localhost' IDENTIFIED BY 'php-crud-api';
19+
GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
20+
FLUSH PRIVILEGES;
21+
EOF
22+
echo "done"
23+
24+
echo -n "[2/4] Starting PostgreSQL 13.4 .. "
25+
# run postgres server
26+
nohup su - -c "/usr/lib/postgresql/13/bin/postgres -D /etc/postgresql/13/main" postgres > /root/postgres.log 2>&1 &
27+
# wait for postgres to become available
28+
until su - -c "psql -U postgres -c '\q'" postgres >/dev/null 2>&1; do
29+
sleep 1;
30+
done
31+
# create database and user on postgres
32+
su - -c "psql -U postgres >/dev/null" postgres << 'EOF'
33+
CREATE USER "php-crud-api" WITH PASSWORD 'php-crud-api';
34+
CREATE DATABASE "php-crud-api";
35+
GRANT ALL PRIVILEGES ON DATABASE "php-crud-api" to "php-crud-api";
36+
\c "php-crud-api";
37+
CREATE EXTENSION IF NOT EXISTS postgis;
38+
\q
39+
EOF
40+
echo "done"
41+
42+
echo -n "[3/4] Starting SQLServer 2017 ... "
43+
echo "skipped"
44+
45+
echo -n "[4/4] Cloning PHP-CRUD-API v2 ... "
46+
# install software
47+
if [ -d /php-crud-api ]; then
48+
echo "skipped"
49+
else
50+
git clone --quiet https://github.com/mevdschee/php-crud-api.git
51+
echo "done"
52+
fi
53+
54+
echo "------------------------------------------------"
55+
56+
# run the tests
57+
cd php-crud-api
58+
php test.php

0 commit comments

Comments
 (0)