Add canary strategy to crash stage in Cloud Deploy pipeline (#3057)

* Add customCanaryDeployment strategy to crash

* change key to partialDeploymentAlertPolicyChecks

* add more indentation to alert policies config
This commit is contained in:
Juan Celhay
2026-05-21 19:39:46 +00:00
committed by GitHub
parent 73725e94fe
commit bd70cd91a5
3 changed files with 66 additions and 10 deletions
+18 -1
View File
@@ -47,7 +47,7 @@ steps:
/^stableDeploymentAlertPolicyChecks:/ { capture = 1; next }
capture {
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
print " " $0
print " " $0
}
' "$config_file" > checks.tmp
@@ -55,6 +55,23 @@ steps:
sed -i '/stableDeploymentAlertPolicyChecks/r checks.tmp' release/clouddeploy/delivery-pipeline.yaml
sed -i '/stableDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
rm -f checks.tmp
# Extract only the indented block under partialDeploymentAlertPolicyChecks.
if grep -q "^partialDeploymentAlertPolicyChecks:" "$config_file"; then
echo "Extracting partial checks from $config_file..."
awk '
/^partialDeploymentAlertPolicyChecks:/ { capture = 1; next }
capture {
if ($0 ~ /^[^[:space:]]/ && $0 != "") { capture = 0; exit }
print " " $0
}
' "$config_file" > partial_checks.tmp
# Insert the checks where the placeholder is located and remove the placeholder
sed -i '/partialDeploymentAlertPolicyChecks/r partial_checks.tmp' release/clouddeploy/delivery-pipeline.yaml
sed -i '/partialDeploymentAlertPolicyChecks/d' release/clouddeploy/delivery-pipeline.yaml
rm -f partial_checks.tmp
fi
# Populate variables in target file
target_file="release/clouddeploy/${env}-target.yaml"