@@ -13,13 +13,11 @@ Tag, promote, and deploy to the test environment, as per the [usual process](htt
1313#### Test locally
1414
1515``` sh
16- ./create_tokens.sh " ../../../../../vita-app-sandpit.pid" " http://localhost:9123" 86400
17-
18- docker build --no-cache -t fake-api .
16+ docker stop local-fake-api # # Will fail if the contain doesn't exist, which is fine
1917
20- docker stop local-fake-api
18+ ./create_tokens.sh " ../../../../../vita-app-sandpit.pid " " http://localhost:9123 " 86400
2119
22- docker run -d --rm -p 9123:9123 -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
20+ docker build --no-cache -t fake-api . && docker run -d --rm -p 9123:9123 -e ELID_DELAY_SECONDS=1 -e APIM_DELAY_SECONDS=1 --name local-fake-api fake-api
2321
2422docker logs local-fake-api --follow | less +F # If you need to see what's going on in nginx
2523
@@ -34,7 +32,7 @@ curl http://localhost:9123/.well-known/openid-configuration | jq
3432curl -v http://localhost:9123/authorize? state=sausages
3533curl -X POST http://localhost:9123/token
3634
37- curl -v http://localhost:9123/nbs
35+ curl -v http://localhost:9123/nbs? any=old & rubbish=here
3836```
3937
4038##### Test against local VitA
@@ -57,7 +55,10 @@ Start up VitA as normal, then hit [/api/sso](https://localhost:3000/api/sso?asse
5755For the following steps, you need to have deployed the infrastructure at least once, to get the ALB DNS name.
5856
5957``` sh
58+ aws sso login --profile vita-test
59+
6060fake_api_url=" http://" $( aws elbv2 describe-load-balancers --profile vita-test | jq -r ' .LoadBalancers[] | select(.LoadBalancerName == "fake-api-project-alb") | .DNSName' )
61+
6162./create_tokens.sh " ../../../../../vita-app-sandpit.pid" " $fake_api_url " 315569520
6263
6364docker build --no-cache --platform linux/amd64 -t fake-api .
@@ -68,8 +69,6 @@ docker build --no-cache --platform linux/amd64 -t fake-api .
6869Ensure you are [ configured to access the test environment in AWS via the command line] ( https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html ) . These instructions assume you've named your profile ` vita-test ` . All the info you need for that should be available via the [ access portal] ( https://d-9c67018f89.awsapps.com/start/#/?tab=accounts ) .
6970
7071``` sh
71- aws sso login --profile vita-test
72-
7372fake_api_ecr_repository_url=$( aws ecr describe-repositories --profile vita-test | jq -r ' .repositories[] | select(.repositoryName == "fake-api") | .repositoryUri' )
7473
7574aws ecr get-login-password --region eu-west-2 --profile vita-test | docker login --username AWS --password-stdin $( echo $fake_api_ecr_repository_url | cut -d/ -f1)
@@ -90,7 +89,8 @@ fake_api_url="http://"$(aws elbv2 describe-load-balancers --profile vita-test |
9089
9190curl -v $fake_api_url /health
9291
93- curl $fake_api_url /eligibility-signposting-api/patient-check/9658218989 | jq
92+ curl $fake_api_url /eligibility-signposting-api/patient-check/9658218989 | jq
93+ curl $fake_api_url /eligibility-signposting-api/patient-check/9658218881 | jq
9494
9595curl -v -X POST $fake_api_url /oauth2/token
9696
0 commit comments