diff --git a/release/cloudbuild-clouddeploy.yaml b/release/cloudbuild-clouddeploy.yaml index ab2d04053..577a4c6c2 100644 --- a/release/cloudbuild-clouddeploy.yaml +++ b/release/cloudbuild-clouddeploy.yaml @@ -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" diff --git a/release/clouddeploy/delivery-pipeline.yaml b/release/clouddeploy/delivery-pipeline.yaml index aa799191d..f49b0fb65 100644 --- a/release/clouddeploy/delivery-pipeline.yaml +++ b/release/clouddeploy/delivery-pipeline.yaml @@ -7,13 +7,34 @@ description: deploy-nomulus is a Cloud native replacement for Spinnaker that ena serialPipeline: stages: - targetId: crash - profiles: - - crash strategy: - standard: - analysis: - # 10 minutes. - duration: 600s - googleCloud: - alertPolicyChecks: - stableDeploymentAlertPolicyChecks + canary: + customCanaryDeployment: + phaseConfigs: + - phaseId: "canary-1" + profiles: ["crash-partial-phase-1"] + percentage: 10 + analysis: + # 10 minutes. + duration: 600s + googleCloud: + alertPolicyChecks: + partialDeploymentAlertPolicyChecks + - phaseId: "canary-5" + profiles: ["crash-partial-phase-5"] + percentage: 50 + analysis: + # 10 minutes. + duration: 600s + googleCloud: + alertPolicyChecks: + partialDeploymentAlertPolicyChecks + - phaseId: "stable" + profiles: ["crash"] + percentage: 100 + analysis: + # 10 minutes. + duration: 600s + googleCloud: + alertPolicyChecks: + stableDeploymentAlertPolicyChecks diff --git a/release/clouddeploy/skaffold.yaml b/release/clouddeploy/skaffold.yaml index 1c6d0968b..9bdc11086 100644 --- a/release/clouddeploy/skaffold.yaml +++ b/release/clouddeploy/skaffold.yaml @@ -11,5 +11,23 @@ profiles: - ../jetty/kubernetes/nomulus-crash-console.yaml - ../jetty/kubernetes/nomulus-crash-frontend.yaml - ../jetty/kubernetes/nomulus-crash-pubapi.yaml + deploy: + kubectl: { } +- name: crash-partial-phase-1 + manifests: + rawYaml: + - ../jetty/kubernetes/nomulus-crash-backend-partial-phase-1.yaml + - ../jetty/kubernetes/nomulus-crash-console-partial-phase-1.yaml + - ../jetty/kubernetes/nomulus-crash-frontend-partial-phase-1.yaml + - ../jetty/kubernetes/nomulus-crash-pubapi-partial-phase-1.yaml + deploy: + kubectl: { } +- name: crash-partial-phase-5 + manifests: + rawYaml: + - ../jetty/kubernetes/nomulus-crash-backend-partial-phase-5.yaml + - ../jetty/kubernetes/nomulus-crash-console-partial-phase-5.yaml + - ../jetty/kubernetes/nomulus-crash-frontend-partial-phase-5.yaml + - ../jetty/kubernetes/nomulus-crash-pubapi-partial-phase-5.yaml deploy: kubectl: { } \ No newline at end of file