Ktlint is used to format the source code and a task runs in the Circle build to check the formatting.
You should run the following commands to make sure that the source code is formatted locally before it breaks the Circle build.
./gradlew ktlintApplyToIdea
Or to apply to all Intellij projects:
./gradlew ktlintApplyToIdeaGlobally
./gradlew addKtlintFormatGitPreCommitHook
The easiest (and slowest) way to run the app is to use docker compose to create the service and all dependencies.
docker-compose pull
docker-compose up
- See
http://localhost:8081/health
to check the app is running. - See
http://localhost:8081/swagger-ui/index.html?configUrl=/v3/api-docs
to explore the OpenAPI spec document.
The following environment variables are required in order for the app to start:
Name | Description |
---|---|
SERVER_PORT | The port that the application will run on |
HMPPS_AUTH_URL | The URL for OAuth 2.0 authorisation server |
Name | Description |
---|---|
DB_SERVER | The host of the DB server |
DB_NAME | The name of the database instance |
DB_USER | The application's DB username |
DB_PASS | The DB user's password |
Name | Description |
---|---|
APPINSIGHTS_INSTRUMENTATIONKEY | The instrumentation key for App Insights |
APPLICATIONINSIGHTS_CONNECTION_STRING | The connection string for App Insights |
APPLICATIONINSIGHTS_CONFIGURATION_FILE | A configuration file for App Insights |
Name | Description |
---|---|
HMPPS_SQS_USE_WEB_TOKEN | Set to true if the DefaultAWSCredentialsProviderChain should be used. |
HMPPS_SQS_TOPICS_DOMAINEVENTS_ARN | The AWS ARN for the shared domain-events topic. |
The API is instrumented with the opentelemetry and Application Insights java agent. Useful data can be found and reported
on via the Azure Application Insights console, all under the cloud_RoleName
property of hmpps-ciag-careers-induction-api
Bring the docker images up using the below command
docker-compose up --scale hmpps-ciag-careers-induction-api=0
set localstack as active profile
set the environment variable to API_BASE_URL_OAUTH = https://sign-in-dev.hmpps.service.justice.gov.uk/auth
The configuration file can be retrieved from .run/HmppsCiagCareersInductionApi.run.xml