mirror of
https://github.com/google/nomulus
synced 2026-08-15 11:46:08 +00:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user