@@ -46,32 +46,26 @@ publish-oas:
4646 npm run publish-oas
4747
4848set-authorization : guard-APIM_ENV
49- @ AUTHORIZATION=authorization- $$ APIM_ENV.yml \
50- envsubst ' $${AUTHORIZATION} ' \
51- < specification/api/components/parameters /authorization/authorization -template.yml > specification/api/components/parameters/authorization /authorization.yml
49+ SPEC_DIR=./specification/api/components/environments
50+ COMPONENT_DIR=./specification/api/components/parameters/authorization
51+ ./scripts/build/substitute_build_env.sh $$ COMPONENT_DIR /authorization-template.yml $$ SPEC_DIR/ $$ APIM_ENV.env $$ COMPONENT_DIR /authorization.yml
5252
53- set-target : guard-APIM_ENV
54- @ TARGET=target-$$ APIM_ENV.yml \
55- envsubst ' $${TARGET}' \
56- < specification/api/components/x-nhsd-apim/target-template.yml > specification/api/components/x-nhsd-apim/target.yml
57-
58- set-access : guard-APIM_ENV
59- @ ACCESS=access-$$ APIM_ENV.yml \
60- envsubst ' $${ACCESS}' \
61- < specification/api/components/x-nhsd-apim/access-template.yml > specification/api/components/x-nhsd-apim/access.yml
53+ set-nhsd-apim : guard-APIM_ENV
54+ SPEC_DIR=./specification/api/components/environments
55+ COMPONENT_DIR=./specification/api/components/x-nhsd-apim
56+ ./scripts/build/substitute_build_env.sh $$ COMPONENT_DIR/x-nhsd-apim-template.yml $$ SPEC_DIR/$$ APIM_ENV.env $$ COMPONENT_DIR/x-nhsd-apim.yml
6257
6358set-security : guard-APIM_ENV
64- @ SECURITY=security- $$ APIM_ENV.yml \
65- envsubst ' $${SECURITY} ' \
66- < specification/api/components/security /security-template.yml > specification/api/components/security /security.yml
67- @ SECURITY_SCHEMES= security-schemes- $$ APIM_ENV.yml \
68- envsubst ' $${SECURITY_SCHEMES} ' \
69- < specification/api/components/security-schemes/security-schemes-template.yml > specification/api/components/security-schemes/security-schemes.yml
59+ SPEC_DIR=./specification/api/components/environments
60+ COMPONENT_DIR=./specification/api/components/security
61+ ./scripts/build/substitute_build_env.sh $$ COMPONENT_DIR /security-template.yml $$ SPEC_DIR/ $$ APIM_ENV.env $$ COMPONENT_DIR /security.yml
62+ COMPONENT_DIR=./specification/api/components/ security-schemes
63+ ./scripts/build/substitute_build_env.sh $$ COMPONENT_DIR/security-schemes-template.yml $$ SPEC_DIR/ $$ APIM_ENV.env $$ COMPONENT_DIR/security-schemes.yml
64+
7065
7166construct-spec : guard-APIM_ENV
67+ $(MAKE ) set-nhsd-apim APIM_ENV=$$ APIM_ENV
7268 $(MAKE ) set-authorization APIM_ENV=$$ APIM_ENV
73- $(MAKE ) set-target APIM_ENV=$$ APIM_ENV
74- $(MAKE ) set-access APIM_ENV=$$ APIM_ENV
7569 $(MAKE ) set-security APIM_ENV=$$ APIM_ENV
7670
7771build-json-oas-spec : guard-APIM_ENV
0 commit comments