Root project for the MOT Reminders service.
Gov Notify integration details
This repository uses git-secrets to prevent secrets from being committed. Please ensure you have git-secrets installed on your machine: https://github.com/awslabs/git-secrets#installing-git-secrets
To build all sub-projects:
./gradlew clean build
ZIP artefacts will reside in: ${sub-project-root}/build/distributions.
To build individual projects:
./gradlew :<sub_project_name>:clean :<sub_project_name>:build
Unit tests are part of the artefact building process (see Building paragraph)
- Java 8/JDK8
- AWS Sam CLI - https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html
- Make sure you are connected to the appropriate VPN service.
- Docker
-
Change directory to docker:
cd docker -
docker compose up- This will create a docker container and images for DynamoDB and Localstack. Please check you have the latest versions of these as they might be cached from previous versions. This should be left in the background and not terminated. -
Open a new terminal and make you are still in the
dockerdirectory -
Make sure AWS credentials are set up and running e.g.
aws_set_creds default && aws_auth_mfa. Use default profile which is identical to dvsamotdev account. -
Create DynamoDB tables -
./init_dynamodb_tables.sh- endpoint = http://localhost:7654 or http://host.docker.internal:7654 -
Create S3 bucket and download assets to Localstack -
./localstack_s3_assets.sh- endpoint = http://localhost:4663
To build the application make sure you are in the root directory and then:
sam build
To run the application locally make sure have a successful build whilst in the root directory and then:
sam local start-api
**Make sure AWS credentials are set up and running e.g. aws_set_creds default && aws_auth_mfa. Use default profile which is identical to dvsamotdev account.
**Make sure you are connected to the VPN.
This will start the application at http:://127.0.0.1:3000. Go to http:://127.0.0.1:3000/start for starting point.
All paths and environments are listed in the template.yaml file.
You can add/edit environment variables and paths as shown below:
Environment:
Variables:
REGION: eu-west-1Events:
VrmGet:
Type: Api
Properties:
Path: /vrm
Method: GET
VrmPost:
Type: Api
Properties:
Path: /vrm
Method: POSTEach time you edit the code or template.yaml you will need to build: sam build and run the application: sam local start-api to see the changes.
Logs for DynamoDB is in this file: docker/log_out