HHH-15533 Introduce versionless CI matrix entries for the PostgreSQL and MySQL minimum supported version

This commit is contained in:
Christian Beikov 2022-09-20 09:26:06 +02:00
parent 5ad3abc628
commit bfd1f22157
7 changed files with 51 additions and 31 deletions

View File

@ -38,9 +38,10 @@ jobs:
- rdbms: h2
- rdbms: hsqldb
- rdbms: derby
- rdbms: mysql
- rdbms: mysql8
- rdbms: mariadb
- rdbms: postgresql_9_5
- rdbms: postgresql
- rdbms: postgresql_13
- rdbms: oracle
- rdbms: db2

17
Jenkinsfile vendored
View File

@ -30,9 +30,10 @@ stage('Configure') {
// new BuildEnvironment( dbName: 'h2' ),
// new BuildEnvironment( dbName: 'hsqldb' ),
// new BuildEnvironment( dbName: 'derby' ),
// new BuildEnvironment( dbName: 'mysql' ),
// new BuildEnvironment( dbName: 'mysql8' ),
// new BuildEnvironment( dbName: 'mariadb' ),
// new BuildEnvironment( dbName: 'postgresql_9_5' ),
// new BuildEnvironment( dbName: 'postgresql' ),
// new BuildEnvironment( dbName: 'postgresql_13' ),
// new BuildEnvironment( dbName: 'oracle' ),
new BuildEnvironment( dbName: 'oracle_ee' ),
@ -116,6 +117,13 @@ stage('Build') {
try {
stage('Start database') {
switch (buildEnv.dbName) {
case "mysql":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('mysql:5.7').pull()
}
sh "./docker_db.sh mysql"
state[buildEnv.tag]['containerName'] = "mysql"
break;
case "mysql8":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('mysql:8.0.21').pull()
@ -130,12 +138,12 @@ stage('Build') {
sh "./docker_db.sh mariadb"
state[buildEnv.tag]['containerName'] = "mariadb"
break;
case "postgresql_9_5":
case "postgresql":
// use the postgis image to enable the PGSQL GIS (spatial) extension
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('postgis/postgis:9.5-2.5').pull()
}
sh "./docker_db.sh postgresql_9_5"
sh "./docker_db.sh postgresql"
state[buildEnv.tag]['containerName'] = "postgres"
break;
case "postgresql_13":
@ -191,13 +199,14 @@ stage('Build') {
case "hsqldb":
runTest("-Pdb=${buildEnv.dbName}${state[buildEnv.tag]['additionalOptions']}")
break;
case "mysql":
case "mysql8":
runTest("-Pdb=mysql_ci${state[buildEnv.tag]['additionalOptions']}")
break;
case "tidb":
runTest("-Pdb=tidb -DdbHost=localhost:4000${state[buildEnv.tag]['additionalOptions']}", 'TIDB')
break;
case "postgresql_9_5":
case "postgresql":
case "postgresql_13":
runTest("-Pdb=pgsql_ci${state[buildEnv.tag]['additionalOptions']}")
break;

View File

@ -130,7 +130,7 @@ The script `docker_db.sh` allows you to start a pre-configured database which ca
All you have to do is run the following command:
----
./docker_db.sh postgresql_9_5
./docker_db.sh postgresql
----
omitting the argument will print a list of possible options.
@ -162,7 +162,7 @@ The following table illustrates a list of commands for various databases that ca
|`./gradlew test -Pdb=derby`
|MySQL 5.7
|`./docker_db.sh mysql_5_7`
|`./docker_db.sh mysql`
|`./gradlew test -Pdb=mysql_ci`
|MySQL 8.0
@ -174,7 +174,7 @@ The following table illustrates a list of commands for various databases that ca
|`./gradlew test -Pdb=mariadb_ci`
|PostgreSQL 9.5
|`./docker_db.sh postgresql_9_5`
|`./docker_db.sh postgresql`
|`./gradlew test -Pdb=pgsql_ci`
|PostgreSQL 13

View File

@ -11,7 +11,7 @@ elif [ "$RDBMS" == "mysql" ]; then
goal="-Pdb=mysql_ci"
elif [ "$RDBMS" == "mariadb" ]; then
goal="-Pdb=mariadb_ci"
elif [ "$RDBMS" == "postgresql_9_5" ]; then
elif [ "$RDBMS" == "postgresql" ]; then
goal="-Pdb=pgsql_ci"
elif [ "$RDBMS" == "postgresql_13" ]; then
goal="-Pdb=pgsql_ci"

View File

@ -3,13 +3,13 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "$RDBMS" == 'mysql' ]; then
bash $DIR/../docker_db.sh mysql_5_7
bash $DIR/../docker_db.sh mysql
elif [ "$RDBMS" == 'mysql8' ]; then
bash $DIR/../docker_db.sh mysql_8_0
elif [ "$RDBMS" == 'mariadb' ]; then
bash $DIR/../docker_db.sh mariadb
elif [ "$RDBMS" == 'postgresql_9_5' ]; then
bash $DIR/../docker_db.sh postgresql_9_5
elif [ "$RDBMS" == 'postgresql' ]; then
bash $DIR/../docker_db.sh postgresql
elif [ "$RDBMS" == 'postgresql_13' ]; then
bash $DIR/../docker_db.sh postgresql_13
elif [ "$RDBMS" == 'db2' ]; then

View File

@ -15,6 +15,10 @@ else
PRIVILEGED_CLI=""
fi
mysql() {
mysql_5_7
}
mysql_5_7() {
$CONTAINER_CLI rm -f mysql || true
$CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake --log-bin-trust-function-creators=1
@ -86,6 +90,10 @@ mariadb() {
fi
}
postgresql() {
postgresql_9_5
}
postgresql_9_5() {
$CONTAINER_CLI rm -f postgres || true
$CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 -d docker.io/postgis/postgis:9.5-2.5
@ -517,6 +525,7 @@ if [ -z ${1} ]; then
echo -e "\thana"
echo -e "\tmariadb"
echo -e "\tmssql"
echo -e "\tmysql"
echo -e "\tmysql_5_7"
echo -e "\tmysql_8_0"
echo -e "\toracle"
@ -527,6 +536,7 @@ if [ -z ${1} ]; then
echo -e "\tpostgis"
echo -e "\tpostgresql_13"
echo -e "\tpostgresql_9_5"
echo -e "\tpostgresql"
echo -e "\tsybase"
else
${1}

View File

@ -16,48 +16,48 @@ In MySQL these are stored as null objects.
<Element>
<id>1</id>
<type>POINT</type>
<wkt>SRID=4326;POINT(10 5)</wkt>
<wkt>SRID=0;POINT(10 5)</wkt>
</Element>
<Element>
<id>2</id>
<type>POINT</type>
<wkt>SRID=4326;POINT(52.25 2.53)</wkt>
<wkt>SRID=0;POINT(52.25 2.53)</wkt>
</Element>
<Element>
<id>3</id>
<type>POINT</type>
<wkt>SRID=4326;POINT(51 12)</wkt>
<wkt>SRID=0;POINT(51 12)</wkt>
</Element>
<Element>
<id>4</id>
<type>POINT</type>
<wkt>SRID=4326;POINT(10.0 2.0)</wkt>
<wkt>SRID=0;POINT(10.0 2.0)</wkt>
</Element>
<Element>
<id>5</id>
<type>LINESTRING</type>
<wkt>SRID=4326;LINESTRING(10.0 5.0, 20.0 15.0)</wkt>
<wkt>SRID=0;LINESTRING(10.0 5.0, 20.0 15.0)</wkt>
</Element>
<Element>
<id>6</id>
<type>LINESTRING</type>
<wkt>SRID=4326;LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0)</wkt>
<wkt>SRID=0;LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0)</wkt>
</Element>
<Element>
<id>11</id>
<type>MULTILINESTRING</type>
<wkt>SRID=4326;MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))</wkt>
<wkt>SRID=0;MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))</wkt>
</Element>
<Element>
<id>12</id>
<type>MULTILINESTRING</type>
<wkt>SRID=4326;MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40
<wkt>SRID=0;MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40
14.0))
</wkt>
</Element>
@ -66,28 +66,28 @@ In MySQL these are stored as null objects.
<Element>
<id>16</id>
<type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) )</wkt>
<wkt>SRID=0;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) )</wkt>
</Element>
<Element>
<id>18</id>
<type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 5, 5 5,5 2, 2 2))</wkt>
<wkt>SRID=0;POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 5, 5 5,5 2, 2 2))</wkt>
</Element>
<Element>
<id>19</id>
<type>POLYGON</type>
<wkt>SRID=4326;POLYGON( (110 110, 110 120, 120 120, 120 110, 110 110) )</wkt>
<wkt>SRID=0;POLYGON( (110 110, 110 120, 120 120, 120 110, 110 110) )</wkt>
</Element>
<Element>
<id>20</id>
<type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, 120 140, 130 134, 105 100)) )</wkt>
<wkt>SRID=0;MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, 120 140, 130 134, 105 100)) )</wkt>
</Element>
<Element>
<id>22</id>
<type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((105 100,
<wkt>SRID=0;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((105 100,
120 140, 130
134, 105 100)) )
</wkt>
@ -97,28 +97,28 @@ In MySQL these are stored as null objects.
<Element>
<id>25</id>
<type>MULTIPOINT</type>
<wkt>SRID=4326;MULTIPOINT(21 2, 25 5, 30 3)</wkt>
<wkt>SRID=0;MULTIPOINT(21 2, 25 5, 30 3)</wkt>
</Element>
<Element>
<id>26</id>
<type>MULTIPOINT</type>
<wkt>SRID=4326;MULTIPOINT(21 2)</wkt>
<wkt>SRID=0;MULTIPOINT(21 2)</wkt>
</Element>
<Element>
<id>30</id>
<type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3))</wkt>
<wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3))</wkt>
</Element>
<Element>
<id>31</id>
<type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0)))</wkt>
<wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0)))</wkt>
</Element>
<Element>
<id>32</id>
<type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0),(1 1, 2 1,
<wkt>SRID=0;GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0),(1 1, 2 1,
2 2, 1 2,
1 1)))
</wkt>
@ -126,7 +126,7 @@ In MySQL these are stored as null objects.
<Element>
<id>33</id>
<type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)),
<wkt>SRID=0;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)),
((105 100,
120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)))
</wkt>