This repository contains the service code for the Find and Refer an Intervention service
.
Most software can be installed using homebrew.
- Docker
- Java SDK (OpenJDK 21)
The application comes with a local
spring profile that includes default settings for running locally. This is not
necessary when deploying to kubernetes as these values are included in the helm configuration templates -
e.g. values-dev.yaml
. This run configuration is included in the
project local run configuration
and can be accessed using the run options in the top right of the window in IntelliJ.
There is also a docker-compose.yml
that can be used to run a local instance of the template in docker and also an
instance of HMPPS Auth.
Run the following command to pull the relevant dependencies for the project.
docker-compose pull
and then the following command to run the containers.
docker-compose -f docker-compose-local.yml up
can optionally be run in detached mode in order to retain terminal use
docker-compose -f docker-compose-local.yml up -d
The service uses a postgres database alongside flyaway migrations to create and populate the database. To connect to the database locally in your preferred database client (IntelliJ Ultimate, Dbeaver, Pgadmin, etc).
Create new connection using local database credentials;
Variable | Value |
---|---|
Port | 5432 |
Username | root |
Password | dev |
The service uses an Oauth 2.0 setup managed through the Hmpps Auth project. To call any endpoints locally a bearer token must be generated. This can be done through calling the auth endpoint in the Hmpps-auth service.
Variable | Value |
---|---|
Grant type | Client credentials |
Access token URL | http://hmpps-auth:9090/auth/oauth/token |
Client ID | ----- |
Client Secret | ----- |
Scope | Read |
For Client ID and Secret refer to the relevant credentials for the Find and Refer Project.
This project has a branch naming validator in place in the GitHub action pipeline.
To ensure these pipelines pass the branch name must conform one of the following patterns:
- FRI-[0-9]/branch-name-here
- no-ticket/branch-name-here
- renovate/branch-name-here
- hotfix/branch-name-here
This project is formatted using ktlint.
Run the following command to add a pre-commit hook to ensure your code is formatted correctly before pushing.
./gradlew addKtlintFormatGitPreCommitHook
For any issues please reach out to the Find and Refer Interventions team in slack #find-refer-interventions-team