mirror of
https://github.com/google/nomulus.git
synced 2025-05-16 17:37:13 +02:00
Add a Gradle task to deploy the proxy (#214)
Also refactored some common code regarding the mapping between environments and projects. The script to update proxy deployments and kill all pods are lifted from https://cs.corp.google.com/piper///depot/google3/domain/registry/tools/bashrc?l=163
This commit is contained in:
parent
2a381b7071
commit
8240dee691
5 changed files with 105 additions and 23 deletions
44
proxy/deploy-proxy-for-env.sh
Executable file
44
proxy/deploy-proxy-for-env.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
# Copyright 2019 The Nomulus Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# This script builds the GAE artifacts for a given environment, moves the
|
||||
# artifacts for all services to a designated location, and then creates a
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: $0 alpha|crash"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
environment=${1}
|
||||
project="domain-registry-"${environment}
|
||||
current_context=$(kubectl config current-context)
|
||||
while read line
|
||||
do
|
||||
parts=(${line})
|
||||
echo "Updating cluster ${parts[0]} in zone ${parts[1]}..."
|
||||
gcloud container clusters get-credentials "${parts[0]}" \
|
||||
--project "${project}" --zone "${parts[1]}"
|
||||
# Kills all running pods, new pods created will be pulling the new image.
|
||||
sed s/GCP_PROJECT/${project}/g "./kubernetes/proxy-deployment-${environment}.yaml" | \
|
||||
kubectl replace -f -
|
||||
# Alpha does not have canary
|
||||
if [[ ${environment} != "alpha" ]]
|
||||
then
|
||||
sed s/GCP_PROJECT/${project}/g "./kubernetes/proxy-deployment-${environment}-canary.yaml" | \
|
||||
kubectl replace -f -
|
||||
fi
|
||||
kubectl delete pods --all
|
||||
done < <(gcloud container clusters list --project ${project} | grep proxy-cluster)
|
||||
kubectl config use-context "$current_context"
|
Loading…
Add table
Add a link
Reference in a new issue