https://github.com/hmcts/bulk-scan-processor
https://github.com/hmcts/bulk-scan-processor
java jenkins-cft jenkins-cft-a-c plan-on-prod scan spring spring-boot
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hmcts/bulk-scan-processor
- Owner: hmcts
- License: mit
- Created: 2018-05-11T10:51:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-09T15:05:23.000Z (over 1 year ago)
- Last Synced: 2025-04-09T16:24:01.221Z (over 1 year ago)
- Topics: java, jenkins-cft, jenkins-cft-a-c, plan-on-prod, scan, spring, spring-boot
- Language: Java
- Homepage:
- Size: 11.4 MB
- Stars: 5
- Watchers: 22
- Forks: 6
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Bulk scan processor

[](https://www.codacy.com/app/HMCTS/bulk-scan-processor)
[](https://codecov.io/gh/hmcts/bulk-scan-processor)
[](https://snyk.io/test/github/hmcts/bulk-scan-processor)
## Purpose
Retrieve scanned documents along with information extracted with OCR engine. Store the images and let recipient
services fetch the new data.
## Getting Started
### Prerequisites
- [JDK 21](https://www.oracle.com/java)
- Project requires Spring Boot v3.x to be present
### Installation
- Clone the repository
- Ensure all required environment variables have been set.
## Quick Start (Alternative)
An alternative faster way getting started is by using the automated setup script. This script will help set up all
bulk scan/print repos including bulk-scan-processor and its dependencies.
See [common-dev-env-bsbp](https://github.com/hmcts/common-dev-env-bsbp) repository for more information.
Once set up script has ran successfully you can move the bulk-scan-processor from the newly created
common-dev-env-bsbp/apps directory to your desired location.
## Building and deploying the application
The project uses [Gradle](https://gradle.org) as a build tool. It already contains
`./gradlew` wrapper script, so there's no need to install gradle.
### Building the application
To build the project execute the following command:
```bash
./gradlew build
```
### Running the application
You will either need to add a .env file if one does not already exist, or add environment variables to your
Application tasks configuration.
If you choose to add a .env file, you will need to add all the
environment variables listed in the [application.yaml](/src/main/resources/application.yaml) file.
For example, ${BULK_SCANNING_DB_PASSWORD:} in the application.yaml file will need to be
added as BULK_SCANNING_DB_PASSWORD="value from keyvault" in your .env file.
Create the image of the application by executing the following command:
```bash
./gradlew assemble
```
Application listens on port `8581` which can be overridden by setting `SERVER_PORT` environment variable or from [.env](/.env) file.
The application depends upon certain components that are already up and running.
Configuration details for each component can be changed by passing values in environment variables:
#### PostgreSQL
* `BULK_SCANNING_DB_HOST`
* `BULK_SCANNING_DB_PORT`
* `BULK_SCANNING_DB_NAME`
* `BULK_SCANNING_DB_USER_NAME`
* `BULK_SCANNING_DB_PASSWORD`
#### Azure Blob Storage
* `STORAGE_ACCOUNT_NAME`
* `STORAGE_KEY`
* `SAS_TOKEN_VALIDITY`
#### Document Management Storage
* `DOCUMENT_MANAGEMENT_URL` working endpoint URL
#### Service to Service Authentication
* `S2S_URL` working endpoint URL
* `S2S_NAME` service name
* `S2S_SECRET` service secret
Please find more details in [infrastructure/main.tf](/infrastructure/main.tf) file.
### Running smoke tests
Smoke tests expect an address of deployed application to be passed in `TEST_URL` environment variable. For example:
```bash
TEST_URL=http://localhost:8561 ./gradlew smoke
```
By default, it will use `http://localhost:8581` which is defined in [src/smokeTest/resources/application.yaml](/src/smokeTest/resources/application.yaml).
### Running integration tests
```bash
./gradlew integration
```
## Migration
To run migration gradle task expects `FLYWAY_URL` to be present. In case db requires username/password: `FLYWAY_USER` and `FLYWAY_PASSWORD`. Once those variables are exported all flyway tasks are available.
```bash
./gradlew flywayMigrate
```
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details