Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/opal-file-handler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: "1.0"
description: A Helm chart for opal-file-handler App
name: opal-file-handler
home: https://github.com/hmcts/opal-file-handler
version: 0.0.35
version: 0.0.36
maintainers:
- name: HMCTS opal team
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions charts/opal-file-handler/values.dev.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ java:
OPAL_FILE_DB_PORT: 5432
RUN_DB_MIGRATION_ON_STARTUP: true
FLYWAY_LOCATIONS: classpath:db/migration/allEnvs
postgresql:
enabled: true
postgresql:
enabled: true
8 changes: 6 additions & 2 deletions charts/opal-file-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ java:
- name: file-handler-POSTGRES-USER
alias: OPAL_FILE_DB_USERNAME
- name: file-handler-POSTGRES-DATABASE
alias: OPAL_FILE_DB_NAME
alias: OPAL_FILE_DB_NAME

environment:
RUN_DB_MIGRATION_ON_STARTUP: true
postgresql:
enabled: false
image:
tag: '17.5.0'
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
services:
opal-file-db:
container_name: opal-file-db
image: postgres:16
image: postgres:17.5
restart: always
environment:
- POSTGRES_DB=opal-file-db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class SingletonPostgreSQLContainer {

private static final PostgreSQLContainer<?> INSTANCE =
new PostgreSQLContainer<>("postgres:17.0")
new PostgreSQLContainer<>("postgres:17.5")
.withDatabaseName("testdb")
.withUsername("testuser")
.withPassword("testpass");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package uk.gov.hmcts.reform.opal.dev;

import com.github.dockerjava.api.model.ExposedPort;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.PortBinding;
import com.github.dockerjava.api.model.Ports;
import org.springframework.boot.devtools.restart.RestartScope;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;

@TestConfiguration(proxyBeanMethods = false)
public class ContainerConfiguration {

@Bean
@ServiceConnection
@RestartScope
PostgreSQLContainer<?> databaseContainer() {
return new PostgreSQLContainer<>("postgres:17.5")
.withCreateContainerCmdModifier(cmd -> {
cmd.withName("test-container-opal-file-db");
cmd.withHostConfig(
new HostConfig().withPortBindings(
new PortBinding(Ports.Binding.bindPort(5434), new ExposedPort(5432))
)
);
})
.withExposedPorts(5432)
.withDatabaseName("opal-file-db")
.withUsername("opal-file")
.withPassword("opal-file")
.withReuse(true);
}
}
13 changes: 13 additions & 0 deletions src/test/java/uk/gov/hmcts/reform/opal/dev/DevApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package uk.gov.hmcts.reform.opal.dev;

import org.springframework.boot.SpringApplication;
import uk.gov.hmcts.reform.opal.Application;

public class DevApplication {

public static void main(String[] args) {
SpringApplication.from(Application::main)
.with(ContainerConfiguration.class)
.run(args);
}
}