This is a skeleton project from which to create new kotlin projects from.
If this is a HMPPS project then the project will be created as part of bootstrapping - see https://github.com/ministryofjustice/dps-project-bootstrap.
When deploying to a new namespace, you may wish to use this template kotlin project namespace as the basis for your new namespace:
Copy this folder, update all the existing namespace references, and submit a PR to the CloudPlatform team. Further instructions from the CloudPlatform team can be found here: https://user-guide.cloud-platform.service.justice.gov.uk/#cloud-platform-user-guide
Once the new repository is deployed. Navigate to the repository in github, and select the Actions
tab.
Click the link to Enable Actions on this repository
.
Find the Action workflow named: rename-project-create-pr
and click Run workflow
. This workflow will
execute the rename-project.bash
and create Pull Request for you to review. Review the PR and merge.
Note: ideally this workflow would run automatically however due to a recent change github Actions are not enabled by default on newly created repos. There is no way to enable Actions other then to click the button in the UI. If this situation changes we will update this project so that the workflow is triggered during the bootstrap project. Further reading: https://github.community/t/workflow-isnt-enabled-in-repos-generated-from-template/136421
Run the rename-project.bash
and create a PR.
The rename-project.bash
script takes a single argument - the name of the project and calculates from it:
- The main class name (project name converted to pascal case)
- The project description (class name with spaces between the words)
- The main package name (project name with hyphens removed)
It then performs a search and replace and directory renames so the project is ready to be used.
Please follow the steps below to deploy:
- Open Terminal
- Check Service Pod Status, Ensure that the service pod is up and running:
kubectl get pods -n <<NAME_SPACE>>
- Copy Chart Files to Service Pod, Use the following command to copy your chart files to the service pod:
kubectl cp <<REPO_LOCATION>>/hmpps-adjudications-insights-api/src/test/resources/test-data <<NAME_SPACE>>/<<SERVICE_POD_NAME>>:/tmp
- Access the Service Pod, Exec into the service pod with:
kubectl exec -it <<SERVICE_POD_NAME>> -n <<NAME_SPACE>> -- /bin/sh
- Navigate to Directory The charts can be found in the
/tmp/test-data
directory. To navigate there, use:cd /tmp/test-data
- Copy Files to S3 Bucket. Use the following command to sync your files to the desired S3 bucket:
aws s3 sync . s3://<<BUCKET_NAME>>
NOTE: Make sure to replace placeholders like <<NAME_SPACE>>
, <<SERVICE_POD_NAME>>
, and <<BUCKET_NAME>>
with appropriate values before running the commands.
Run localstack by running the below docker compose:
docker-compose up
With localstack now up and running, run:
./gradlew test
To run the app, the following profiles need to be enabled: 'dev,localstack,local' therefore with gradle, run:
./gradlew bootRun --args='--spring.profiles.active=localstack,local'