@@ -53,39 +53,51 @@ config:: # Configure development environment (main) @Configuration
5353# ### Proxygen ####
5454# #################
5555
56- retrieve-proxygen-key : # Obtain the 'machine user' credentials from AWS SSM (Development environment)
57- mkdir -p ~ /.proxygen && \
58- aws ssm get-parameter --name /proxygen/private_key_temp --with-decryption | jq " .Parameter.Value" --raw-output \
59- > ~ /.proxygen/eligibility-signposting-api.pem
60-
61- setup-proxygen-credentials : # Copy Proxygen templated credentials to where it expected them
62- cd specification && cp -r .proxygen ~
56+ # Verify current AWS account login and retrieve the proxygen key
57+ # from AWS SSM Parameter Store
58+ retrieve-proxygen-key : guard-ENV
59+ @ ./scripts/check-aws-account.sh
60+ mkdir -p ~ /.proxygen
61+ aws ssm get-parameter --name /$$ ENV/proxygen/private_key --with-decryption \
62+ | jq -r " .Parameter.Value" \
63+ > ~ /.proxygen/eligibility-signposting-api-$(ENV ) .pem && \
64+ echo " Retrieved proxygen key for APIM '$( ENV) ' environment"
65+
66+ # Copy proxygen credentials for the specified environment to `~/.proxygen/`
67+ # This location required location for local proxygen usage
68+ setup-proxygen-credentials : guard-ENV
69+ @ cd specification && \
70+ cp .proxygen/credentials-$(ENV ) .yaml ~ /.proxygen/credentials.yaml && \
71+ cp .proxygen/settings-$(ENV ) .yaml ~ /.proxygen/settings.yaml && \
72+ echo " Set up proxygen credentials for the APIM '$( ENV) ' environment"
6373
6474get-spec : # Get the most recent specification live in proxygen
65- $(MAKE ) setup-proxygen-credentials
75+ $(MAKE ) setup-proxygen-credentials ENV=prod
6676 proxygen spec get
6777
6878get-spec-uat : # Get the most recent specification live in proxygen
69- $(MAKE ) setup-proxygen-credentials
79+ $(MAKE ) setup-proxygen-credentials ENV=prod
7080 proxygen spec get --uat
7181
7282publish-spec : # Publish the specification to proxygen
73- $(MAKE ) setup-proxygen-credentials
83+ $(MAKE ) setup-proxygen-credentials ENV=prod
7484 proxygen spec publish build/specification/prod/eligibility-signposting-api.yaml
7585
7686publish-spec-uat : # Publish the specification to proxygen
77- $(MAKE ) setup-proxygen-credentials
87+ $(MAKE ) setup-proxygen-credentials ENV=prod
7888 proxygen spec publish build/specification/preprod/eligibility-signposting-api.yaml --uat
7989
8090delete-spec : # Delete the specification from proxygen
81- $(MAKE ) setup-proxygen-credentials
91+ $(MAKE ) setup-proxygen-credentials ENV=prod
8292 proxygen spec delete
8393
8494delete-spec-uat : # Delete the specification from proxygen
85- $(MAKE ) setup-proxygen-credentials
95+ $(MAKE ) setup-proxygen-credentials ENV=prod
8696 proxygen spec delete --uat
8797
88- # Specification
98+ # ####################
99+ # ## Specification ###
100+ # ####################
89101
90102guard-% :
91103 @ if [ " ${${* } } " = " " ]; then \
0 commit comments