-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathcloudbuild_app_dart.yaml
40 lines (34 loc) · 1.48 KB
/
cloudbuild_app_dart.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Provide instructions for google Cloud Build to auto-build flutter
# dashboard to flutter-dashboard project. Auto-build will be triggered
# by daily schedule on `main` branch. This cloudbuild calls an additional
# cloudbuild configuration responsible for deployment.
#
# This job is for generating the docker image with build provenance,
# and the deployment job uses the generated docker image and deploys it to
# App Engine.
steps:
# Build dashboard.
# This step generates the dashboard files using flutter, then moves the
# generated files into the app_dart folder, where a docker image is then
# created in the next step.
- name: us-docker.pkg.dev/$PROJECT_ID/flutter/flutter
entrypoint: '/bin/bash'
args: ['cloud_build/dashboard_build.sh']
# Build docker image
- name: 'us-docker.pkg.dev/cloud-builders/ga/v1/docker'
args: ['build', '-t', 'us-docker.pkg.dev/$PROJECT_ID/appengine/default.version-$SHORT_SHA', '-f', 'Dockerfile.app_dart', '.']
# Trigger the cloud build that deploys the docker image
- name: gcr.io/cloud-builders/gcloud
entrypoint: '/bin/bash'
args:
- '-c'
- |-
gcloud builds submit \
--config app_dart/cloudbuild_app_dart_deploy.yaml \
--substitutions="SHORT_SHA=$SHORT_SHA" \
--async
timeout: 1200s
images: ['us-docker.pkg.dev/$PROJECT_ID/appengine/default.version-$SHORT_SHA']
# If build provenance is not generated, the docker deployment will fail.
options:
requestedVerifyOption: VERIFIED