Skip to content

Commit f4fb98a

Browse files
CCM-12673 - Make PR proxies temporary
1 parent 789c093 commit f4fb98a

39 files changed

+88
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ dist
2727
/sandbox/*.log
2828
/sandbox-staging
2929
/specification/api/components/examples
30+
/specification/api/components/x-nhsd-apim/x-nhsd-apim.yml
3031
/scripts/JWT/*.pem

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ set-security: guard-APIM_ENV
6969
< specification/api/components/security-schemes/security-schemes-template.yml > specification/api/components/security-schemes/security-schemes.yml
7070

7171
construct-spec: guard-APIM_ENV
72+
SPEC_DIR=./specification/api/components/x-nhsd-apim
73+
./scripts/build/substitute_build_env.sh $$SPEC_DIR/x-nhsd-apim-template.yml $$SPEC_DIR/$$APIM_ENV.env $$SPEC_DIR/x-nhsd-apim.yml
7274
$(MAKE) set-authorization APIM_ENV=$$APIM_ENV
73-
$(MAKE) set-target APIM_ENV=$$APIM_ENV
74-
$(MAKE) set-access APIM_ENV=$$APIM_ENV
7575
$(MAKE) set-security APIM_ENV=$$APIM_ENV
7676

7777
build-json-oas-spec: guard-APIM_ENV
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TEMPLATE="$1"
5+
ENV_FILE="$2"
6+
OUT="$3"
7+
8+
# Extract variable names from the env file (left side of KEY=VALUE)
9+
VARS=$(grep -E '^[A-Za-z_][A-Za-z0-9_]*=' "$ENV_FILE" | cut -d= -f1)
10+
11+
# Build envsubst variable list ($VAR1 $VAR2 ...)
12+
VARLIST=""
13+
for v in $VARS; do
14+
VARLIST="$VARLIST \$$v"
15+
done
16+
VARLIST="${VARLIST# }" # remove leading space
17+
18+
# Export values from the env file
19+
set -a
20+
source "$ENV_FILE"
21+
set +a
22+
23+
# Run envsubst only on the selected variables
24+
envsubst "$VARLIST" < "$TEMPLATE" > "$OUT"
25+
26+
echo "Generated: $OUT"

specification/api/components/x-nhsd-apim/access-template.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

specification/api/components/x-nhsd-apim/access.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MONITORING_FLAG=false
2+
TEMPORARY_FLAG=false
3+
ENV_DIR=./int

specification/api/components/x-nhsd-apim/access-int.yml renamed to specification/api/components/x-nhsd-apim/int/access.yml

File renamed without changes.

specification/api/components/x-nhsd-apim/rate-limiting.yml renamed to specification/api/components/x-nhsd-apim/int/rate-limiting.yml

File renamed without changes.

specification/api/components/x-nhsd-apim/target-attributes.yml renamed to specification/api/components/x-nhsd-apim/int/target-attributes.yml

File renamed without changes.

specification/api/components/x-nhsd-apim/target-int.yml renamed to specification/api/components/x-nhsd-apim/int/target.yml

File renamed without changes.

0 commit comments

Comments
 (0)