Skip to content

Commit

Permalink
MAP-1450 Add Wiremock and Localstack setups and workflows
Browse files Browse the repository at this point in the history
Created Dockerfiles for hmpps-wiremock and hmpps-localstack with necessary configurations. Added mock mappings for attribute-search and ping endpoints in Wiremock. Updated GitHub Actions workflows to include Wiremock and Localstack docker build and Trivy scan.
  • Loading branch information
Mjwillis committed Aug 7, 2024
1 parent 9aab59e commit e96b26f
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- hmpps-devops-tools
- hmpps-mssql-tools
- hmpps-mysql-tools
- hmpps-wiremock
- hmpps-localstack
- hmpps-clamav
- hmpps-python-deps
permissions:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/trivy_scan_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- hmpps-mssql-tools
- hmpps-mysql-tools
- hmpps-clamav
- hmpps-wiremock
- hmpps-localstack
permissions:
packages: write
contents: read
Expand Down
5 changes: 5 additions & 0 deletions hmpps-localstack/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM localstack/localstack:stable
RUN chown localstack:localstack -R /tmp/localstack && \
chown localstack:localstack -R /var/lib/localstack
USER 1000

7 changes: 7 additions & 0 deletions hmpps-wiremock/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM wiremock/wiremock:latest
RUN addgroup --gid 2000 --system wiremock && adduser --uid 2000 --system wiremock --gid 2000

COPY --chown=wiremock:wiremock wiremock /home/wiremock

USER 2000
ENTRYPOINT ["/docker-entrypoint.sh", "--port=8090", "--global-response-templating", "--disable-gzip", "--verbose"]
19 changes: 19 additions & 0 deletions hmpps-wiremock/wiremock/__files/attribute-search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"empty": true,
"totalPages": 0,
"totalElements": 0,
"first": true,
"last": true,
"size": 0,
"number": 0,
"numberOfElements": 10,
"pageable": {
"offset": 0,
"pageSize": 0,
"paged": true,
"pageNumber": 0,
"unpaged": true
},
"content": [
]
}
3 changes: 3 additions & 0 deletions hmpps-wiremock/wiremock/__files/ping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"status": "UP"
}
13 changes: 13 additions & 0 deletions hmpps-wiremock/wiremock/mappings/atrribute-search.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "POST",
"urlPath": "/attribute-search"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"bodyFileName": "attribute-search.json"
}
}
13 changes: 13 additions & 0 deletions hmpps-wiremock/wiremock/mappings/ping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"request": {
"method": "GET",
"urlPath": "/health/ping"
},
"response": {
"status": 200,
"bodyFileName": "ping.json",
"headers": {
"Content-Type": "application/json"
}
}
}

0 comments on commit e96b26f

Please sign in to comment.