Skip to content

Commit 2042c35

Browse files
committed
Add ubuntu 2204
1 parent 0c5b547 commit 2042c35

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ I am testing mainly on Ubuntu and I have the following test setups:
13961396
- (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3) and SQLite 3.16
13971397
- (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4) and SQLite 3.22
13981398
- (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5) and SQLite 3.27
1399-
- (Docker) Ubuntu 20.04 with PHP 7.4, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLite 3.31
1399+
- (Docker) Ubuntu 20.04 with PHP 7.4, MySQL 8.0, PostgreSQL 12.2 (PostGIS 3.0) and SQLServer 2019 and SQLite 3.31
14001400
- (Docker) CentOS 8 with PHP 8.1, MariaDB 10.7, PostgreSQL 12.10 (PostGIS 3.0) and SQLite 3.26
14011401
- (Docker) Debian 11 with PHP 7.4, MariaDB 10.5, PostgreSQL 13.4 (PostGIS 3.1) and SQLite 3.34
14021402

docker/ubuntu22/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:22.04
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+
mysql-server mysql-client php-mysql \
9+
postgresql php-pgsql \
10+
postgresql-14-postgis-3 \
11+
sqlite3 php-sqlite3 \
12+
git wget \
13+
curl gnupg
14+
15+
# install locales
16+
RUN apt-get -y install locales
17+
RUN locale-gen en_US.UTF-8
18+
RUN update-locale LANG=en_US.UTF-8
19+
20+
# install run script
21+
ADD run.sh /usr/sbin/docker-run
22+
CMD docker-run

docker/ubuntu22/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 " Ubuntu 22.04 (PHP 8.1)"
4+
echo "================================================"
5+
6+
echo -n "[1/4] Starting MySQL 8.0 ........ "
7+
# run mysql server
8+
nohup mysqld > /root/mysql.log 2>&1 &
9+
# wait for mysql to become available
10+
while ! mysqladmin ping -hlocalhost >/dev/null 2>&1; do
11+
sleep 1
12+
done
13+
# create database and user on mysql
14+
mysql -u root >/dev/null << 'EOF'
15+
CREATE DATABASE `php-crud-api` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
16+
CREATE USER 'php-crud-api'@'localhost' IDENTIFIED WITH MYSQL_NATIVE_PASSWORD BY 'php-crud-api';
17+
GRANT ALL PRIVILEGES ON `php-crud-api`.* TO 'php-crud-api'@'localhost' WITH GRANT OPTION;
18+
FLUSH PRIVILEGES;
19+
EOF
20+
echo "done"
21+
22+
echo -n "[2/4] Starting PostgreSQL 14.2 .. "
23+
# ensure statistics can be written
24+
mkdir /var/run/postgresql/10-main.pg_stat_tmp/ && chmod 777 /var/run/postgresql/10-main.pg_stat_tmp/
25+
# run postgres server
26+
nohup su - -c "/usr/lib/postgresql/14/bin/postgres -D /etc/postgresql/14/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 2019 ... "
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)