Skip to content

Commit 0398e44

Browse files
committed
1 parent 6dc2e7b commit 0398e44

File tree

108 files changed

+8434
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+8434
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- rdbms: mysql
3737
- rdbms: mariadb
3838
- rdbms: postgresql
39+
- rdbms: gaussdb
3940
- rdbms: edb
4041
- rdbms: oracle
4142
- rdbms: db2

ci/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ elif [ "$RDBMS" == "mariadb" ] || [ "$RDBMS" == "mariadb_10_4" ]; then
1414
goal="-Pdb=mariadb_ci"
1515
elif [ "$RDBMS" == "postgresql" ] || [ "$RDBMS" == "postgresql_13" ]; then
1616
goal="-Pdb=pgsql_ci"
17+
elif [ "$RDBMS" == "gaussdb" ]; then
18+
goal="-Pdb=gaussdb -DdbHost=localhost:5432"
1719
elif [ "$RDBMS" == "edb" ] || [ "$RDBMS" == "edb_13" ]; then
1820
goal="-Pdb=edb_ci -DdbHost=localhost:5444"
1921
elif [ "$RDBMS" == "oracle" ]; then

ci/database-start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ elif [ "$RDBMS" == 'mariadb' ]; then
88
bash $DIR/../docker_db.sh mariadb
99
elif [ "$RDBMS" == 'postgresql' ]; then
1010
bash $DIR/../docker_db.sh postgresql
11+
elif [ "$RDBMS" == 'gaussdb' ]; then
12+
bash $DIR/../docker_db.sh gaussdb
1113
elif [ "$RDBMS" == 'edb' ]; then
1214
bash $DIR/../docker_db.sh edb
1315
elif [ "$RDBMS" == 'db2' ]; then

docker_db.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,49 @@ postgresql_17() {
211211
$CONTAINER_CLI exec postgres bash -c '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt install -y postgresql-17-pgvector && psql -U hibernate_orm_test -d hibernate_orm_test -c "create extension vector;"'
212212
}
213213

214+
gaussdb() {
215+
$CONTAINER_CLI rm -f opengauss || true
216+
217+
# config param
218+
CONTAINER_NAME=opengauss
219+
IMAGE=opengauss/opengauss:7.0.0-RC1
220+
PORT=5432
221+
DB_USER=hibernate_orm_test
222+
DB_PASSWORD=Hibernate_orm_test@1234
223+
DB_NAME=hibernate_orm_test
224+
PSQL_IMAGE=postgres:14
225+
226+
echo "start OpenGauss container..."
227+
$CONTAINER_CLI run --name ${CONTAINER_NAME} \
228+
--privileged \
229+
-e GS_PASSWORD=${DB_PASSWORD} \
230+
-e GS_NODENAME=opengauss \
231+
-e GS_PORT=${PORT} \
232+
-e GS_CGROUP_DISABLE=YES \
233+
-p ${PORT}:5432 \
234+
-d ${IMAGE}
235+
236+
echo "wait OpenGauss starting..."
237+
sleep 20
238+
239+
echo " Initialize the database using the PostgreSQL client container..."
240+
241+
$CONTAINER_CLI run --rm --network=host ${PSQL_IMAGE} \
242+
bash -c "
243+
PGPASSWORD='${DB_PASSWORD}' psql -h localhost -p ${PORT} -U gaussdb -d postgres -c \"CREATE USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';\" &&
244+
PGPASSWORD='${DB_PASSWORD}' psql -h localhost -p ${PORT} -U gaussdb -d postgres -c \"CREATE DATABASE ${DB_NAME} OWNER ${DB_USER};\" &&
245+
PGPASSWORD='${DB_PASSWORD}' psql -h localhost -p ${PORT} -U gaussdb -d ${DB_NAME} -c \"CREATE SCHEMA test AUTHORIZATION ${DB_USER};\"
246+
"
247+
248+
echo "Initialization completed"
249+
echo "connection information£º"
250+
echo " Host: localhost"
251+
echo " Port: ${PORT}"
252+
echo " Username: ${DB_USER}"
253+
echo " Password: ${DB_PASSWORD}"
254+
echo " Database: ${DB_NAME}"
255+
}
256+
214257
edb() {
215258
edb_17
216259
}
@@ -1089,6 +1132,7 @@ if [ -z ${1} ]; then
10891132
echo -e "\toracle"
10901133
echo -e "\toracle_23"
10911134
echo -e "\toracle_21"
1135+
echo -e "\tgauss"
10921136
echo -e "\tpostgresql"
10931137
echo -e "\tpostgresql_17"
10941138
echo -e "\tpostgresql_16"

0 commit comments

Comments
 (0)