blob: 0eb2aa35b5709626d6c251b505ea8bd20527d354 [file] [log] [blame]
# Copyright 2019 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
steps:
# Get recently pushed docker image and associated provenance, along with the
# correct docker digest url, including the hash.
- name: gcr.io/cloud-builders/gcloud
entrypoint: '/bin/bash'
args:
- '-c'
- |-
cloud_build/get_docker_image_provenance.sh \
us-docker.pkg.dev/$PROJECT_ID/appengine/triage_bot.version-$SHORT_SHA:latest \
unverified_provenance.json
# Verify provenance is valid before proceeding with deployment.
- name: 'golang:1.20'
entrypoint: '/bin/bash'
args:
- '-c'
- |-
cloud_build/verify_provenance.sh unverified_provenance.json
# Deploy a new version to google cloud.
- name: gcr.io/cloud-builders/gcloud
entrypoint: '/bin/bash'
args:
- '-c'
- |-
gcloud config set project $PROJECT_ID
latest_version=$(gcloud app versions list --hide-no-traffic --format 'value(version.id)')
if [ "$latest_version" = "version-$SHORT_SHA" ]; then
echo "No updates since last deployment."
else
bash cloud_build/deploy_triage_bot.sh $PROJECT_ID $SHORT_SHA
fi
timeout: 1200s