diff --git a/tool/build_image_proxy.yaml b/tool/build_image_proxy.yaml new file mode 100644 index 0000000000..29a9488908 --- /dev/null +++ b/tool/build_image_proxy.yaml @@ -0,0 +1,29 @@ +# Configuration for Google Cloud Build +# +# Triggers in the project kicks off a cloud build task based on the +# configuration in this file. Permissions granted to this task is configured +# by granting permissions to the service account: +# @cloudbuild.gserviceaccount.com +# +# Reference: https://cloud.google.com/cloud-build/docs/build-config +steps: + - name: 'gcr.io/cloud-builders/docker' + script: | + #!/usr/bin/env bash + set -x + if [[ "$PROJECT_ID" != dartlang-pub ]]; then + echo 'Only deploy from the dartlang-pub project' + exit 1; + fi + if [[ "$TAG_NAME" != image_proxy-* ]]; then + echo 'This script is only intended for use on image_proxy- tags' + exit 1; + fi + docker build -t us-central1-docker.pkg.dev/$PROJECT_ID/image-proxy-server:$TAG_NAME . --file pkg/image_proxy/Dockerfile + env: + - 'PROJECT_ID=$PROJECT_ID' + - 'BRANCH_NAME=$BRANCH_NAME' + - 'TAG_NAME=$TAG_NAME' +images: + - 'us-central1-docker.pkg.dev/$PROJECT_ID/image-proxy-server:$TAG_NAME' +timeout: '5400s'