Skip to content

Commit 76ac820

Browse files
Vojtěch Šalbababeikov
authored andcommitted
Add support for testing with custom EDB image
1 parent a82fe2d commit 76ac820

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

docker_db.sh

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,30 +186,42 @@ edb() {
186186

187187
edb_12() {
188188
$CONTAINER_CLI rm -f edb || true
189-
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
190-
(cd edb; $CONTAINER_CLI build -t edb-test:12 -f edb12.Dockerfile .)
191-
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:12
189+
if [[ -z "${DB_IMAGE_EDB}" ]]; then
190+
DB_IMAGE_EDB="edb-test:12"
191+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
192+
(cd edb; $CONTAINER_CLI build -t edb-test:12 -f edb12.Dockerfile .)
193+
fi
194+
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d $DB_IMAGE_EDB
192195
}
193196

194197
edb_14() {
195198
$CONTAINER_CLI rm -f edb || true
196-
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
197-
(cd edb; $CONTAINER_CLI build -t edb-test:14 -f edb14.Dockerfile .)
198-
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:14
199+
if [[ -z "${DB_IMAGE_EDB}" ]]; then
200+
DB_IMAGE_EDB="edb-test:14"
201+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
202+
(cd edb; $CONTAINER_CLI build -t edb-test:14 -f edb14.Dockerfile .)
203+
fi
204+
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d $DB_IMAGE_EDB
199205
}
200206

201207
edb_15() {
202208
$CONTAINER_CLI rm -f edb || true
203-
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
204-
(cd edb; $CONTAINER_CLI build -t edb-test:15 -f edb15.Dockerfile .)
205-
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:15
209+
if [[ -z "${DB_IMAGE_EDB}" ]]; then
210+
DB_IMAGE_EDB="edb-test:15"
211+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
212+
(cd edb; $CONTAINER_CLI build -t edb-test:15 -f edb15.Dockerfile .)
213+
fi
214+
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d $DB_IMAGE_EDB
206215
}
207216

208217
edb_16() {
209218
$CONTAINER_CLI rm -f edb || true
210-
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
211-
(cd edb; $CONTAINER_CLI build -t edb-test:16 -f edb16.Dockerfile .)
212-
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:16
219+
if [[ -z "${DB_IMAGE_EDB}" ]]; then
220+
DB_IMAGE_EDB="edb-test:16"
221+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
222+
(cd edb; $CONTAINER_CLI build -t edb-test:16 -f edb16.Dockerfile .)
223+
fi
224+
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d $DB_IMAGE_EDB
213225
}
214226

215227
db2() {

0 commit comments

Comments
 (0)