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
4 changes: 2 additions & 2 deletions release/cloudbuild-clouddeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ steps:
- -c
- |
set -e
for env in crash sandbox; do
for env in crash sandbox production; do
config_file="release/clouddeploy/${env}-config.yaml"
if [ -f "$config_file" ]; then
echo "Extracting checks from $config_file..."
Expand Down Expand Up @@ -100,7 +100,7 @@ steps:
- -c
- |
set -e
for env in crash sandbox; do
for env in crash sandbox production; do
target_file="release/clouddeploy/${env}-target.yaml"
if [ -f "$target_file" ]; then
echo "Applying target $target_file..."
Expand Down
1 change: 1 addition & 0 deletions release/cloudbuild-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ steps:
awk 'NR==1,/^---$/ {if ($0 != "---") print}' ./jetty/kubernetes/nomulus-${env}-epp-server.yaml | \
sed s/name:\ epp-server/name:\ epp-server-partial-phase/g | \
sed s/service:\ epp-server/deployment:\ epp-server-partial-phase/g | \
sed s/value:\ epp-server/value:\ epp-server-partial-phase/g | \
sed "/^spec:$/a\ replicas: ${stage}" \
> ./jetty/kubernetes/nomulus-${env}-epp-server-partial-phase-${stage}.yaml
done
Expand Down
73 changes: 73 additions & 0 deletions release/clouddeploy/delivery-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,78 @@ serialPipeline:
googleCloud:
alertPolicyChecks:
sandboxStableDeploymentAlertPolicyChecks
- targetId: production
strategy:
canary:
customCanaryDeployment:
phaseConfigs:
- phaseId: "canary-1"
profiles: ["production-partial-phase-1"]
percentage: 10
predeploy:
tasks:
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-verify-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-verify-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionPartialDeploymentAlertPolicyChecks
- phaseId: "canary-5"
profiles: ["production-partial-phase-5"]
percentage: 50
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionPartialDeploymentAlertPolicyChecks
- phaseId: "stable"
profiles: ["production"]
percentage: 100
postdeploy:
tasks:
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
DEPLOYED_IMAGE: ${{ deploy_params['deployed_image'] }}
BASE_IMAGE: ${{ deploy_params['base_image'] }}
TARGET_ID: ${{ target.id }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud container images add-tag $DEPLOYED_IMAGE \
${BASE_IMAGE}:live-cd-${TARGET_ID} --quiet
- type: container
image: gcr.io/google.com/cloudsdktool/google-cloud-cli:stable
env:
TARGET_ID: ${{ target.id }}
TAG_NAME: ${{ deploy_params['tag_name'] }}
PROJECT_ID: ${{ deploy_params['project_id'] }}
command: ["/bin/bash"]
args:
- "-c"
- |
gcloud storage cp gs://${PROJECT_ID}-deploy/${TAG_NAME}/cloudbuild-schema-deploy-${TARGET_ID}.yaml .
gcloud builds submit --no-source --config=cloudbuild-schema-deploy-${TARGET_ID}.yaml
analysis:
# 10 minutes.
duration: 600s
googleCloud:
alertPolicyChecks:
productionStableDeploymentAlertPolicyChecks
---
apiVersion: deploy.cloud.google.com/v1
kind: Automation
Expand All @@ -148,6 +220,7 @@ selector:
targets:
- id: crash
- id: sandbox
- id: production
rules:
- advanceRolloutRule:
id: advance-canary-phases
Expand Down
30 changes: 30 additions & 0 deletions release/clouddeploy/production-target.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: production
requireApproval: true
executionConfigs:
- usages:
- PREDEPLOY
- RENDER
- ANALYSIS
- POSTDEPLOY
executionTimeout: 3600s
defaultPool:
# Placeholder: Replace with artifact bucket name.
artifactStorage: artifactStorage
# Placeholder: Replace with project number.
serviceAccount: serviceAccount
- usages:
- DEPLOY
executionTimeout: 3600s
privatePool:
# Placeholder: Replace with worker pool name.
workerPool: workerPool
# Placeholder: Replace with artifact bucket name.
artifactStorage: artifactStorage
# Placeholder: Replace with project number.
serviceAccount: serviceAccount
gke:
# Placeholder: Replace with project ID, location, and cluster name.
cluster: cluster
30 changes: 30 additions & 0 deletions release/clouddeploy/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,35 @@ profiles:
- ../../jetty/kubernetes/nomulus-sandbox-frontend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-sandbox-pubapi-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-sandbox-epp-server-partial-phase-5.yaml
deploy:
kubectl: { }
- name: production
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend.yaml
- ../../jetty/kubernetes/nomulus-production-console.yaml
- ../../jetty/kubernetes/nomulus-production-frontend.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server.yaml
deploy:
kubectl: { }
- name: production-partial-phase-1
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-console-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-frontend-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi-partial-phase-1.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server-partial-phase-1.yaml
deploy:
kubectl: { }
- name: production-partial-phase-5
manifests:
rawYaml:
- ../../jetty/kubernetes/nomulus-production-backend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-console-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-frontend-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-pubapi-partial-phase-5.yaml
- ../../jetty/kubernetes/nomulus-production-epp-server-partial-phase-5.yaml
deploy:
kubectl: { }
Loading