1#!/bin/bash 2# Copyright (C) 2021 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# This script deploys the AppEngine instance that acts as a proxy for the GCS 17# bucket gs://perfetto.dev. This does NOT need to be re-deployed when docs 18# change. See go/perfetto-ui-autopush for details. 19 20set -eu 21 22readonly CUR_DIR="$(cd -P ${BASH_SOURCE[0]%/*}; pwd)" 23 24cd $CUR_DIR 25 26VERSION=testing 27PROMOTE=--no-promote 28 29while [[ $# -gt 0 ]]; do 30 key="$1" 31 case $key in 32 --prod) 33 VERSION=prod 34 PROMOTE=--promote 35 shift 36 ;; 37 *) 38 echo "Usage: $0 [--prod]" 39 echo " --prod Deploy prod version" 40 echo " -h|--help Display this message" 41 exit 0 42 shift 43 ;; 44 esac 45done 46 47set -x 48gcloud app deploy app.yaml --project perfetto-site \ 49 -v $VERSION $PROMOTE --stop-previous-version 50