Skip to content

Commit d8a0463

Browse files
committed
CCM-17605: add optional shard count input
1 parent b02ab0c commit d8a0463

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
# --internalRef <ref> \
1515
# --overrides <overrides> \
1616
# --overrideProjectName <name> \
17-
# --overrideRoleName <name>
17+
# --overrideRoleName <name> \
18+
# --shardCount <count>
1819

1920
#
2021
# All arguments are required except terraformAction, and internalRef.
@@ -30,7 +31,8 @@
3031
# --internalRef "main" \
3132
# --overrides "tf_var=someString" \
3233
# --overrideProjectName nhs \
33-
# --overrideRoleName nhs-service-iam-role
34+
# --overrideRoleName nhs-service-iam-role \
35+
# --shardCount "6"
3436

3537
set -e
3638

@@ -48,7 +50,8 @@ Usage:
4850
[--internalRef <ref>] \
4951
[--overrides <overrides>] \
5052
[--overrideProjectName <name>] \
51-
[--overrideRoleName <name>]
53+
[--overrideRoleName <name>] \
54+
[--shardCount <count>]
5255
EOF
5356
return 0
5457
}
@@ -112,6 +115,10 @@ while [[ $# -gt 0 ]]; do
112115
overrideRoleName="$2"
113116
shift 2
114117
;;
118+
--shardCount) # Number of parallel shards to split tests across (optional)
119+
shardCount="$2"
120+
shift 2
121+
;;
115122
*)
116123
echo "[ERROR] Unknown argument: $1" >&2
117124
exit 1
@@ -208,6 +215,7 @@ echo " internalRef: $internalRef"
208215
echo " overrides: $overrides"
209216
echo " overrideProjectName: $overrideProjectName"
210217
echo " overrideRoleName: $overrideRoleName"
218+
echo " shardCount: ${shardCount:-}"
211219

212220
DISPATCH_EVENT=$(jq -ncM \
213221
--arg internalRef "$internalRef" \
@@ -221,13 +229,15 @@ DISPATCH_EVENT=$(jq -ncM \
221229
--arg overrides "$overrides" \
222230
--arg overrideProjectName "$overrideProjectName" \
223231
--arg overrideRoleName "$overrideRoleName" \
232+
--arg shardCount "${shardCount:-}" \
224233
'{
225234
"ref": $internalRef,
226235
"inputs": (
227236
(if $infraRepoName != "" then { "infraRepoName": $infraRepoName } else {} end) +
228237
(if $terraformAction != "" then { "terraformAction": $terraformAction } else {} end) +
229238
(if $overrideProjectName != "" then { "overrideProjectName": $overrideProjectName } else {} end) +
230239
(if $overrideRoleName != "" then { "overrideRoleName": $overrideRoleName } else {} end) +
240+
(if $shardCount != "" then { "shardCount": $shardCount } else {} end) +
231241
{
232242
"releaseVersion": $releaseVersion,
233243
"targetEnvironment": $targetEnvironment,

infrastructure/terraform/components/examplecomponent/pre.sh.disabled

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ echo "COMPONENT=$COMPONENT"
2828
echo "AWS_REGION=$REGION"
2929
echo "AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID"
3030

31+
# No build steps required for output action
32+
if [ "${ACTION}" = "output" ]; then
33+
echo "ACTION=output: skipping build and dependency steps."
34+
return 0
35+
fi
36+
3137
# Calculate container image prefix from PROJECT, ENVIRONMENT, COMPONENT
3238
CONTAINER_IMAGE_PREFIX="${PROJECT}-${ENVIRONMENT}-${COMPONENT}"
3339
echo "CONTAINER_IMAGE_PREFIX: ${CONTAINER_IMAGE_PREFIX}"

0 commit comments

Comments
 (0)