blob: c77d24569d6b40aa7ba51919abf404b510171a5b [file]
steps:
# Try to pull the latest image for caching
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args:
- '-c'
- 'docker pull us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:latest || exit 0'
# Do the build
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
# Use the cache, maybe.
- '--cache-from'
- 'us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:latest'
# Pass the Cloud Build substitution into the Dockerfile ARG
- '--build-arg'
- 'FLUTTER_VERSION=$_FLUTTER_VERSION'
# Tag it with the specific version in Artifact Registry
- '-t'
- 'us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:$_FLUTTER_VERSION'
# Also tag it as latest in Artifact Registry
- '-t'
- 'us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:latest'
- 'cloud_build/flutter_agy_docker'
# Define the default version here so manual triggers still work
substitutions:
_FLUTTER_VERSION: "3.44.2"
images:
- 'us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:$_FLUTTER_VERSION'
- 'us-docker.pkg.dev/flutter-infra/flutter-infra/flutter_docker:latest'
# Force Cloud Build to send logs directly to Cloud Logging
# instead of an autogenerated GCS bucket
options:
logging: CLOUD_LOGGING_ONLY