This project is generated from ministryofjustice/hmpps-template-kotlin
Requires Java 17 or above
Provides a front end for Management Information Visualisation and Presentation
This project uses gradle which is bundled with the repository and also makes use of
- micronaut - for compile time dependency injection
- lombok - to reduce boilerplate when creating data classes
- jacoco - for test coverage reports
- Add implementation("com.h2database:h2:2.1.214") to build.gradle
- Change the existing datasource config in the application.yml file to the following:
jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: create-drop
datasource:
url: jdbc:h2:mem:datamart;MODE=PostgreSQL;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS domain\;
username: sa
password: sa
driver-class-name: org.h2.Driver
- Add the following two environment variables on intellij run configuration
HMPPS_AUTH_URL https://sign-in-dev.hmpps.service.justice.gov.uk/auth
AUTHORISED_ROLES ROLE_PRISONS_REPORTING_TOOLS_USER
- Optional: Change the org.springframework.security level to DEBUG in logback-spring.xml
- Run main from DigitalPrisonReportingMi
Note - test coverage reports are enabled by default and after running the tests the report will be written to build/reports/jacoco/test/html
The unit tests use JUnit5 and Mockito where appropriate. Use the following to run the tests.
./gradlew clean test
Please adhere to the following guidelines when making contributions to the project.
- Keep all code commentary and documentation up to date
- Use a JIRA ticket number where available
- Otherwise a short descriptive name is acceptable
- Prefix any commit messages with the JIRA ticket number where available
- Otherwise use the prefix
NOJIRA
- Reference or link any relevant JIRA tickets in the pull request notes
- At least one approval is required before a PR can be merged
The app is deployed to the namespace: hmpps-dpr-tools-<env>
.
Config for the dev environment can be found here: https://github.com/ministryofjustice/cloud-platform-environments/tree/main/namespaces/live.cloud-platform.service.justice.gov.uk/hmpps-dpr-tools-dev
Additionally, the RedShift credentials need to be manually deployed to each environment. The file redshift-jdbc-secret.yaml
should be updated with the base64 encoded values and applied to the environment.
NB: Please do not commit these changes to redshift-jdbc-secret.yaml
.
Example of base64 encoding a secret value:
echo -n 'placeholder' | base64
Example of applying the secret to an environment:
kubectl -n hmpps-dpr-tools-dev apply -f redshift-jdbc-secret.yaml