Skip to content

Commit 3b638c2

Browse files
CCM-16444 Populate config table
1 parent 72c1a69 commit 3b638c2

96 files changed

Lines changed: 2205 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ while [[ $# -gt 0 ]]; do
104104
version="$2"
105105
shift 2
106106
;;
107+
--tableName) # Table name (optional)
108+
tableName="$2"
109+
shift 2
110+
;;
107111
*)
108112
echo "[ERROR] Unknown argument: $1"
109113
exit 1
@@ -202,6 +206,10 @@ if [[ -z "$version" ]]; then
202206
version=""
203207
fi
204208

209+
if [{ -z "$tableName" }]; then
210+
tableName=""
211+
fi
212+
205213
echo "==================== Workflow Dispatch Parameters ===================="
206214
echo " infraRepoName: $infraRepoName"
207215
echo " releaseVersion: $releaseVersion"
@@ -221,6 +229,7 @@ echo " apimEnvironment: $apimEnvironment"
221229
echo " boundedContext: $boundedContext"
222230
echo " targetDomain: $targetDomain"
223231
echo " version: $version"
232+
echo " tableName: $tableName"
224233

225234
DISPATCH_EVENT=$(jq -ncM \
226235
--arg infraRepoName "$infraRepoName" \
@@ -240,6 +249,7 @@ DISPATCH_EVENT=$(jq -ncM \
240249
--arg boundedContext "$boundedContext" \
241250
--arg targetDomain "$targetDomain" \
242251
--arg version "$version" \
252+
--arg tableName "$tableName" \
243253
'{
244254
"ref": "'"$internalRef"'",
245255
"inputs": (
@@ -255,6 +265,7 @@ DISPATCH_EVENT=$(jq -ncM \
255265
(if $boundedContext != "" then { "boundedContext": $boundedContext } else {} end) +
256266
(if $targetDomain != "" then { "targetDomain": $targetDomain } else {} end) +
257267
(if $version != "" then { "version": $version } else {} end) +
268+
(if $tableName != "" then { "tableName": $tableName } else {} end) +
258269
(if $targetAccountGroup != "" then { "targetAccountGroup": $targetAccountGroup } else {} end) +
259270
{
260271
"releaseVersion": $releaseVersion,
@@ -269,7 +280,7 @@ echo "[INFO] Triggering workflow '$targetWorkflow' in nhs-notify-internal..."
269280
echo "[DEBUG] Dispatch event payload: $DISPATCH_EVENT"
270281

271282
trigger_response=$(curl -s -L \
272-
--fail \
283+
--fail-with-body \
273284
-X POST \
274285
-H "Accept: application/vnd.github+json" \
275286
-H "Authorization: Bearer ${PR_TRIGGER_PAT}" \

.github/workflows/stage-3-build.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,31 @@ jobs:
184184
runId: "${{ github.run_id }}"
185185
buildSandbox: true
186186
releaseVersion: ${{ github.head_ref || github.ref_name }}
187+
populate-config:
188+
name: "Populate Supplier Config"
189+
runs-on: ubuntu-latest
190+
needs: [pr-create-dynamic-environment]
191+
timeout-minutes: 10
192+
193+
steps:
194+
- name: "Checkout code"
195+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
196+
- name: Set Environment Name
197+
id: set-environment
198+
run: echo "environment_name=${{ inputs.pr_number != '' && format('pr{0}', inputs.pr_number) || 'main' }}" >> $GITHUB_OUTPUT
199+
- name: "Trigger populate config workflow in internal repo"
200+
env:
201+
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
202+
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
203+
PR_NUMBER: ${{ inputs.pr_number }}
204+
shell: bash
205+
run: |
206+
.github/scripts/dispatch_internal_repo_workflow.sh \
207+
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
208+
--releaseVersion ${{ github.head_ref || github.ref_name }} \
209+
--targetWorkflow "publish-supplier-config.yaml" \
210+
--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
211+
--targetComponent "config" \
212+
--targetAccountGroup "nhs-notify-suppliers-dev" \
213+
--tableName "supplier-config" \
214+
--internalRef "feature/CCM-12444-supplier-config-publishing-workflow"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-aspiring"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 3
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 6
26+
}
27+
},
28+
"description": "Colour printing, ASPIRING envelope, Attachment",
29+
"id": "digitrials-aspiring",
30+
"name": "Digitrials - ASPIRING",
31+
"packSpecificationIds": [
32+
"digitrials-aspiring"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-dmapp"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing",
29+
"id": "digitrials-dmapp",
30+
"name": "Digitrials - DMAPP",
31+
"packSpecificationIds": [
32+
"notify-admail"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-globalminds"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail?, colour printing, booklet",
29+
"id": "digitrials-globalminds",
30+
"name": "Digitrials - Global Minds",
31+
"packSpecificationIds": [
32+
"digitrials-globalminds"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-mymelanoma"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing, MyMelanoma envelope",
29+
"id": "digitrials-mymelanoma",
30+
"name": "Digitrials - MyMelanoma",
31+
"packSpecificationIds": [
32+
"digitrials-mymelanoma"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-ofh"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail, colour printing, OFH envelope",
29+
"id": "digitrials-ofh",
30+
"name": "Digitrials - Our Future Health",
31+
"packSpecificationIds": [
32+
"digitrials-ofh"
33+
],
34+
"status": "PROD",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-prostateprogress"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 4
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 8
26+
}
27+
},
28+
"description": "Colour printing, PP envelope, Attachment",
29+
"id": "digitrials-prostateprogress",
30+
"name": "Digitrials - Prostate Progress",
31+
"packSpecificationIds": [
32+
"digitrials-prostateprogress"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-protectc"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Economy, colour printing",
29+
"id": "digitrials-protectc",
30+
"name": "Digitrials - PROTECT-C",
31+
"packSpecificationIds": [
32+
"notify-c5-colour"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"campaignIds": [
3+
"digitrials-restore"
4+
],
5+
"clientId": "digitrials",
6+
"constraints": {
7+
"blackCoveragePercentage": {
8+
"operator": "LESS_THAN",
9+
"value": 20
10+
},
11+
"colourCoveragePercentage": {
12+
"operator": "LESS_THAN",
13+
"value": 10
14+
},
15+
"deliveryDays": {
16+
"operator": "LESS_THAN",
17+
"value": 3
18+
},
19+
"sheets": {
20+
"operator": "LESS_THAN",
21+
"value": 5
22+
},
23+
"sides": {
24+
"operator": "LESS_THAN",
25+
"value": 10
26+
}
27+
},
28+
"description": "Admail?, colour printing, booklet",
29+
"id": "digitrials-restore",
30+
"name": "Digitrials - Restore",
31+
"packSpecificationIds": [
32+
"digitrials-restore"
33+
],
34+
"status": "INT",
35+
"supplierId": "datagraphic",
36+
"type": "STANDARD",
37+
"volumeGroupId": "datagraphic"
38+
}

0 commit comments

Comments
 (0)