Skip to content

Commit a232456

Browse files
Update to use template files to avoid changes on each commit
1 parent e79b67f commit a232456

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,19 @@ lint-oas:
4343
publish-oas:
4444
npm run publish-oas
4545

46+
set-target: guard-APIM_ENV
47+
@ TARGET=target-$$APIM_ENV.yml \
48+
envsubst '$${TARGET}' \
49+
< specification/api/components/x-nhsd-apim/target-template.yml > specification/api/components/x-nhsd-apim/target.yml
50+
51+
set-access: guard-APIM_ENV
52+
@ ACCESS=access-$$APIM_ENV.yml \
53+
envsubst '$${ACCESS}' \
54+
< specification/api/components/x-nhsd-apim/access-template.yml > specification/api/components/x-nhsd-apim/access.yml
55+
4656
construct-spec: guard-APIM_ENV
47-
cd specification/api/components/x-nhsd-apim
48-
cp access-$(APIM_ENV).yml access.yml
49-
cp target-$(APIM_ENV).yml target.yml
50-
cd -
57+
$(MAKE) set-target APIM_ENV=$$APIM_ENV
58+
$(MAKE) set-access APIM_ENV=$$APIM_ENV
5159

5260
build-json-oas-spec: guard-APIM_ENV
5361
$(MAKE) construct-spec APIM_ENV=$$APIM_ENV
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$ref: $ACCESS
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[]
1+
$ref: access-sandbox.yml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$ref: $TARGET
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
type: hosted
2-
healthcheck: /_status
3-
containers:
4-
- name: nhs-notify-supplier
5-
image:
6-
name: nhs-notify-supplier
7-
tag: pr99
8-
environment:
9-
LOG_LEVEL: info
10-
NODE_ENV: development
1+
$ref: target-sandbox.yml

0 commit comments

Comments
 (0)