Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/scripts/dispatch_internal_repo_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ while [[ $# -gt 0 ]]; do
version="$2"
shift 2
;;
--tableName) # Table name (optional)
tableName="$2"
shift 2
;;
--force) # Force apply flag (optional)
force="$2"
shift 2
;;
*)
echo "[ERROR] Unknown argument: $1"
exit 1
Expand Down Expand Up @@ -202,6 +210,14 @@ if [[ -z "$version" ]]; then
version=""
fi

if [{ -z "$tableName" }]; then
tableName=""
fi

if [[ -z "$force" ]]; then
force=""
fi

echo "==================== Workflow Dispatch Parameters ===================="
echo " infraRepoName: $infraRepoName"
echo " releaseVersion: $releaseVersion"
Expand All @@ -221,6 +237,8 @@ echo " apimEnvironment: $apimEnvironment"
echo " boundedContext: $boundedContext"
echo " targetDomain: $targetDomain"
echo " version: $version"
echo " tableName: $tableName"
echo " force: $force"

DISPATCH_EVENT=$(jq -ncM \
--arg infraRepoName "$infraRepoName" \
Expand All @@ -240,6 +258,8 @@ DISPATCH_EVENT=$(jq -ncM \
--arg boundedContext "$boundedContext" \
--arg targetDomain "$targetDomain" \
--arg version "$version" \
--arg tableName "$tableName" \
--arg force "$force" \
'{
"ref": "'"$internalRef"'",
"inputs": (
Expand All @@ -255,6 +275,8 @@ DISPATCH_EVENT=$(jq -ncM \
(if $boundedContext != "" then { "boundedContext": $boundedContext } else {} end) +
(if $targetDomain != "" then { "targetDomain": $targetDomain } else {} end) +
(if $version != "" then { "version": $version } else {} end) +
(if $tableName != "" then { "tableName": $tableName } else {} end) +
(if $force != "" then { "force": $force } else {} end) +
(if $targetAccountGroup != "" then { "targetAccountGroup": $targetAccountGroup } else {} end) +
{
"releaseVersion": $releaseVersion,
Expand All @@ -269,7 +291,7 @@ echo "[INFO] Triggering workflow '$targetWorkflow' in nhs-notify-internal..."
echo "[DEBUG] Dispatch event payload: $DISPATCH_EVENT"

trigger_response=$(curl -s -L \
--fail \
--fail-with-body \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${PR_TRIGGER_PAT}" \
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ jobs:
--targetAccountGroup "nhs-notify-supplier-api-dev" \
--terraformAction "apply" \
--overrideProjectName "nhs" \
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy" \
--internalRef "feature/CCM-12444-supplier-config-publishing-workflow"
artefact-proxies:
name: "Build proxies"
runs-on: ubuntu-latest
Expand All @@ -184,3 +185,32 @@ jobs:
runId: "${{ github.run_id }}"
buildSandbox: true
releaseVersion: ${{ github.head_ref || github.ref_name }}
populate-config:
name: "Populate Supplier Config"
runs-on: ubuntu-latest
needs: [pr-create-dynamic-environment]
timeout-minutes: 10

steps:
- name: "Checkout code"
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Set Environment Name
id: set-environment
run: echo "environment_name=${{ inputs.pr_number != '' && format('pr{0}', inputs.pr_number) || 'main' }}" >> $GITHUB_OUTPUT
- name: "Trigger populate config workflow in internal repo"
env:
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }}
APP_PEM_FILE: ${{ secrets.APP_PEM_FILE }}
PR_NUMBER: ${{ inputs.pr_number }}
shell: bash
run: |
.github/scripts/dispatch_internal_repo_workflow.sh \
--infraRepoName "$(echo ${{ github.repository }} | cut -d'/' -f2)" \
--releaseVersion ${{ github.head_ref || github.ref_name }} \
--targetWorkflow "publish-supplier-config.yaml" \
--targetEnvironment "${{ steps.set-environment.outputs.environment_name }}" \
--targetComponent "config" \
--targetAccountGroup "nhs-notify-suppliers-dev" \
--tableName "supplier-config" \
--internalRef "feature/CCM-12444-supplier-config-publishing-workflow" \
--force "false"
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-aspiring.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-aspiring"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 3
},
"sides": {
"operator": "LESS_THAN",
"value": 6
}
},
"description": "Colour printing, ASPIRING envelope, Attachment",
"id": "digitrials-aspiring",
"name": "Digitrials - ASPIRING",
"packSpecificationIds": [
"digitrials-aspiring"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-dmapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-dmapp"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing",
"id": "digitrials-dmapp",
"name": "Digitrials - DMAPP",
"packSpecificationIds": [
"notify-admail"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-globalminds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-globalminds"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail?, colour printing, booklet",
"id": "digitrials-globalminds",
"name": "Digitrials - Global Minds",
"packSpecificationIds": [
"digitrials-globalminds"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-mymelanoma.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-mymelanoma"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing, MyMelanoma envelope",
"id": "digitrials-mymelanoma",
"name": "Digitrials - MyMelanoma",
"packSpecificationIds": [
"digitrials-mymelanoma"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-ofh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-ofh"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Admail, colour printing, OFH envelope",
"id": "digitrials-ofh",
"name": "Digitrials - Our Future Health",
"packSpecificationIds": [
"digitrials-ofh"
],
"status": "PROD",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-prostateprogress"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 4
},
"sides": {
"operator": "LESS_THAN",
"value": 8
}
},
"description": "Colour printing, PP envelope, Attachment",
"id": "digitrials-prostateprogress",
"name": "Digitrials - Prostate Progress",
"packSpecificationIds": [
"digitrials-prostateprogress"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
38 changes: 38 additions & 0 deletions config/suppliers/letter-variant/digitrials-protectc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"campaignIds": [
"digitrials-protectc"
],
"clientId": "digitrials",
"constraints": {
"blackCoveragePercentage": {
"operator": "LESS_THAN",
"value": 20
},
"colourCoveragePercentage": {
"operator": "LESS_THAN",
"value": 10
},
"deliveryDays": {
"operator": "LESS_THAN",
"value": 3
},
"sheets": {
"operator": "LESS_THAN",
"value": 5
},
"sides": {
"operator": "LESS_THAN",
"value": 10
}
},
"description": "Economy, colour printing",
"id": "digitrials-protectc",
"name": "Digitrials - PROTECT-C",
"packSpecificationIds": [
"notify-c5-colour"
],
"status": "INT",
"supplierId": "datagraphic",
"type": "STANDARD",
"volumeGroupId": "datagraphic"
}
Loading
Loading