- JDK 21
$ make test
Some tests are a bit flaky so are automatically retried in CI. If you want this feature locally, run CI=true make test
Builds and deployments are set up in Circle CI
and configured in the config file.
Helm is used to deploy the service to a Kubernetes Cluster using templates in the helm_deploy
folder.
Mostly runs against dev services, uses localstack for the queues
$ make run-local
AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns publish \
--topic-arn arn:aws:sns:eu-west-2:000000000000:courtcasestopic \
--message-attributes file://$(pwd)/src/test/resources/examples/commonPlatformMessageAttributes.json \
--message file://$(pwd)/src/test/resources/examples/commonPlatformMessage.json
You can retrieve the queue URLs from the secrets like this (preprod court cases queue URL):
cloud-platform decode-secret -n hmpps-person-record-preprod -s sqs-cpr-court-cases-secret | jq -r '.data.sqs_queue_url'
We can access queues, topics and all other AWS dependencies using the service pod provided by cloud-platform. There is currently an instance running in preprod and prod - see the link above for instructions on how to get a shell on it.
Then you can run AWS CLI commands on the pod like this:
aws sqs get-queue-attributes --queue-url <COURT_CASES_QUEUE_URL> --attribute-names ApproximateNumberOfMessages
AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns create-topic --name courteventstopic.fifo --attributes '{"FifoTopic": "true", "ContentBasedDeduplication": "true"}'
AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name cpr_court_events_queue.fifo --attributes '{"FifoQueue": "true", "ContentBasedDeduplication": "true"}'
AWS_REGION=eu-west-2 AWS_ACCESS_KEY_ID=key AWS_SECRET_ACCESS_KEY=secret aws --endpoint-url=http://localhost:4566 sns subscribe --topic-arn arn:aws:sns:eu-west-2:000000000000:courteventstopic.fifo --protocol sqs --notification-endpoint arn:aws:sqs:eu-west-2:000000000000:cpr_court_events_queue.fifo