1# Copyright 2021 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15set -eux 16 17 18export PROJECT=oss-fuzz 19export IMAGE=gcr.io/oss-fuzz-base/triage-party 20export SERVICE_NAME=triage-party 21export CONFIG_FILE=config/examples/oss-fuzz.yaml 22 23 24# Copy triage-party into tmp dir, and copy config into correct spot 25readonly clean_repo=$(mktemp -d) 26git clone --depth 1 https://github.com/google/triage-party.git "${clean_repo}" 27cp ./oss-fuzz.yaml "${clean_repo}"/${CONFIG_FILE} 28cd "${clean_repo}" 29 30 31docker build -t "${IMAGE}" --build-arg "CFG=./${CONFIG_FILE}" . 32docker push "${IMAGE}" || exit 2 33 34readonly token="$(cat "${GITHUB_TOKEN_PATH}")" 35gcloud beta run deploy "${SERVICE_NAME}" \ 36 --project "${PROJECT}" \ 37 --image "${IMAGE}" \ 38 --set-env-vars="GITHUB_TOKEN=${token},PERSIST_BACKEND=cloudsql,PERSIST_PATH=tp:${DB_PASS}@tcp(oss-fuzz/us-central1/triage-party)/tp" \ 39 --allow-unauthenticated \ 40 --region us-central1 \ 41 --memory 384Mi \ 42 --platform managed 43