Skip to content

Commit

Permalink
TSK-2185: upgrade postgres to version 14.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzheboka authored and arolfes committed Mar 28, 2023
1 parent 0197e42 commit b2da591
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .run/Postgres.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Postgres" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="bash ./docker-databases/prepare_db.sh POSTGRES_10 &amp;&amp; exit" />
<option name="SCRIPT_TEXT" value="bash ./docker-databases/prepare_db.sh POSTGRES_14 &amp;&amp; exit" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static Optional<JdbcDatabaseContainer<?>> createDockerContainer(DB db) {
.withDatabaseName("TSKDB"));
case POSTGRES:
return Optional.of(
new PostgreSQLContainer<>(DockerImageName.parse("postgres:10"))
new PostgreSQLContainer<>(DockerImageName.parse("postgres:14.7"))
.withUsername("postgres")
.withPassword("postgres")
.withDatabaseName("postgres")
Expand All @@ -52,7 +52,7 @@ public static Optional<JdbcDatabaseContainer<?>> createDockerContainer(DB db) {
"-c",
"localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8 "
+ "&& export LANG=de_DE.UTF-8 "
+ "&& ./docker-entrypoint.sh postgres -c fsync=off")
+ "&& /usr/local/bin/docker-entrypoint.sh postgres -c fsync=off")
.waitingFor(
new LogMessageWaitStrategy()
.withRegEx(".*Datenbanksystem ist bereit, um Verbindungen anzunehmen.*\\s")
Expand Down
4 changes: 2 additions & 2 deletions docker-databases/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
taskana-postgres_10:
build: postgres_10
taskana-postgres_14:
build: postgres_14
ports:
- 5102:5432
environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM postgres:10
FROM postgres:14.7
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
ENV LANG de_DE.utf8
22 changes: 11 additions & 11 deletions docker-databases/prepare_db.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SETLOCAL
ECHO 1 - Start DB2 11.5
ECHO 2 - Stop DB2 11.5
ECHO.
ECHO 3 - Start POSTGRES 10
ECHO 4 - Stop POSTGRES 10
ECHO 3 - Start POSTGRES 14
ECHO 4 - Stop POSTGRES 14
ECHO.
ECHO 5 - Start ORACLE 18
ECHO 6 - Stop ORACLE 18
Expand All @@ -22,8 +22,8 @@ SETLOCAL
ECHO.
IF [%MENU%]==[1] GOTO START_DB2_11_5
IF [%MENU%]==[2] GOTO STOP_DB2_11_5
IF [%MENU%]==[3] GOTO START_POSTGRES_10
IF [%MENU%]==[4] GOTO STOP_POSTGRES_10
IF [%MENU%]==[3] GOTO START_POSTGRES_14
IF [%MENU%]==[4] GOTO STOP_POSTGRES_14
IF [%MENU%]==[5] GOTO START_ORACLE_18
IF [%MENU%]==[6] GOTO STOP_ORACLE_18
IF [%MENU%]==[7] GOTO STOP_ALL
Expand All @@ -44,19 +44,19 @@ SETLOCAL
ECHO ---
GOTO MENU

:START_POSTGRES_10
:START_POSTGRES_14
ECHO ---
ECHO docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_10
docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_10
ECHO docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_14
docker-compose -f %~dp0/docker-compose.yml up -d taskana-postgres_14

ECHO ---
GOTO MENU

:STOP_POSTGRES_10
:STOP_POSTGRES_14
ECHO ---
ECHO docker stop taskana-postgres_10
ECHO docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_10
docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_10
ECHO docker stop taskana-postgres_14
ECHO docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_14
docker-compose -f %~dp0/docker-compose.yml rm -f -s -v taskana-postgres_14
ECHO ---
GOTO MENU

Expand Down
8 changes: 4 additions & 4 deletions docker-databases/prepare_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export TOP_PID=$$
#H
#H database:
#H - DB2 | DB2_11_5
#H - POSTGRES | POSTGRES_10
#H - POSTGRES | POSTGRES_14
#H - ORACLE | ORACLE_18
# Arguments:
# $1: exit code
Expand All @@ -37,8 +37,8 @@ function mapDBToDockerComposeServiceName() {
DB2|DB2_11_5)
echo "taskana-db2_11-5"
;;
POSTGRES|POSTGRES_10)
echo "taskana-postgres_10"
POSTGRES|POSTGRES_14)
echo "taskana-postgres_14"
;;
ORACLE|ORACLE_18)
echo "taskana-oracle-18"
Expand All @@ -58,7 +58,7 @@ function main() {
DB2|DB2_11_5)
docker-compose -f $scriptDir/docker-compose.yml up -d "$(mapDBToDockerComposeServiceName "$1")"
;;
POSTGRES|POSTGRES_10)
POSTGRES|POSTGRES_14)
docker-compose -f $scriptDir/docker-compose.yml up -d "$(mapDBToDockerComposeServiceName "$1")"
;;
ORACLE|ORACLE_18)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static Optional<JdbcDatabaseContainer<?>> createDockerContainer(DB db) {
.withDatabaseName("TSKDB"));
case POSTGRES:
return Optional.of(
new PostgreSQLContainer<>(DockerImageName.parse("postgres:10"))
new PostgreSQLContainer<>(DockerImageName.parse("postgres:14.7"))
.withUsername("postgres")
.withPassword("postgres")
.withDatabaseName("postgres")
Expand All @@ -52,7 +52,7 @@ public static Optional<JdbcDatabaseContainer<?>> createDockerContainer(DB db) {
"-c",
"localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8 "
+ "&& export LANG=de_DE.UTF-8 "
+ "&& ./docker-entrypoint.sh postgres -c fsync=off")
+ "&& /usr/local/bin/docker-entrypoint.sh postgres -c fsync=off")
.waitingFor(
new LogMessageWaitStrategy()
.withRegEx(".*Datenbanksystem ist bereit, um Verbindungen anzunehmen.*\\s")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ private static void startPostgresDb() {
"cmd.exe",
"/c",
"docker-compose -f ../../docker-databases/docker-compose.yml up -d "
+ "taskana-postgres_10");
+ "taskana-postgres_14");
} else {
builder.command(
"sh",
"-c",
"docker-compose -f ../../docker-databases/docker-compose.yml up -d "
+ "taskana-postgres_10");
+ "taskana-postgres_14");
}
Process process = builder.start();
LOGGER.info("Starting POSTGRES...");
Expand Down

0 comments on commit b2da591

Please sign in to comment.