The code to replace the processing logic of Bichard 7.
- Structure of this Monorepo
- Quickstart
- Running Packages locally
- Publishing package updates
- Testing
- Excluding Triggers
- Conductor
Packages:
Install the following required components:
This project has a number of external dependencies that need building in order to run the whole stack. Check the
following out and run make build in each repository:
- Docker Images
- Make command is
SKIP_GOSS=true make build-localfor this repo
- Make command is
- Bichard7 Next (Old Bichard)
- Make command is
make buildfor this repo, or make build-debugif you need to run Bichard in debug mode
- Make command is
- PNC Emulator
- Make command is
make buildfor this repo
- Make command is
- BeanConnect
- Make command is
SKIP_GOSS=true make buildfor this repo
- Make command is
- Audit Logging
- Make command is
make build-api-server build-event-handler-serverfor this repo
- Make command is
- User Service
- Navigate to packages/user-service and run
make build
- Navigate to packages/user-service and run
- UI
- Navigate to packages/ui and run
make build
- Navigate to packages/ui and run
Bichard relies on a number of containers to run from end to end. These can all be booted up by running:
aws-vault exec bichard7-shared -- npm run allThis will pull down the images from ECR so you don't need to build them. On an M1 Mac, see below.
You can also run subsets of the infrastructure using:
npm run bichard-legacywill run old Bichard, ActiveMQ, Postgres, BeanConnect, PNC Emulator, User Service, Auth Proxy and the new UInpm run conductorwill run Conductor, Postgres, Localstack and the workernpm run conductor-no-workerwill run Conductor, Postgres, Localstack and will not run the worker (for development purposes)
You can also run the end-to-end tests against core in Conductor with:
npm run test:e2eFinally, to bring all of that infrastructure down again, you can use:
npm run destroy- Use Intellij (VS Code doesn't work for debugging) to open the bichard7-next project
- Build a debug image using
make clean build-debug - Run the legacy infrastructure using
npm run bichard-legacy-debugfrom the Core repo - In IntelliJ select
Run >> Edit Configurationsfrom the menu - Click the
+button in the top left and selectRemote JVM Debug - Set the port to
7777and give the configuration a name - Select
Run >> Debugand then choose the configuration you just created - Click the green bug icon and you should see
Connected to the target VM, address: 'localhost:7777', transport: 'socket'printed out - Set breakpoints then use Bichard and IntelliJ will let you step through the code
We can't pull the images down from ECR for an M1 Mac because they are not in ARM format. Therefore, it is necessary to build the relevant images yourself.
- In the bichard7-next-infrastructure-docker-images repository, run
make build-localto just build the required images - Follow the instructions in the bichard7-next repository to build the Bichard Open Liberty image
- In the user-service package, run
make buildor the top level of bichard7-next-core run this script./scripts/build-user-service-docker.sh - In the ui package, run
make buildor the top level of bichard7-next-core run this script./scripts/build-ui-docker.sh
- From the root directory
npm ci - Run
npm run build:core - If you need to change
packages/commonyou have to two options,buildwill just build the package once orwatchall listen for changes and rebuild. You can either:cd packages/common- And run
npm run build - Or
npm run watch
- And run
- Or from the root of Core:
npm run build -w packages/common- Or,
npm run watch -w packages/common
- Go to the package you want to change and follow that package's README
The code in this repository is packaged in the @moj-bichard7-developers/bichard7-next-core NPM package.
To deploy a new version of the package:
- Manually bump the version number in
package.jsonin your PR. It's recommended to follow semantic versioning principles. - Merge your PR into the
mainbranch. - Run the
ReleaseGitHub action against themainbranch, by clicking the "Run workflow" button in the Actions interface.
To run unit tests against the new Bichard:
npm i # If packages not already installed
npm tTo run unit tests against old Bichard (requires the old Bichard stack to be running):
npm i # If packages not already installed
npm run test:bichardTriggers can be excluded for either a specific force or court by adding the trigger code (e.g, TRPR0001) to either data/excluded-trigger-configuration.json for production systems or data/excluded-trigger-configuration.test.json for test environments.
The choice of which excluded-trigger-configuration file to use is decided in src/lib/excludedTriggerConfig.ts using the NODE_ENV environment variable. The test configuration file (excluded-trigger-configuration.test.json) is run if NODE_ENV is set as testing.
| Environment Variable | Description |
|---|---|
| NODE_ENV | The environment node is being run in |
See README in packages/conductor for more information.