forked from google/nomulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudbuild-sync-and-tag.yaml
102 lines (102 loc) · 2.92 KB
/
cloudbuild-sync-and-tag.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This pipeline syncs the folder gs://[PROJECT_ID]-deploy/[TAG] to gs://[PROJECT_ID]-deploy/live.
# It also adds a "live" tag to various images in gcr.io/[PROJECT_ID]/[IMAGE]:[TAG].
# The PROJECT_ID is the current project name that gcloud uses.
#
# To manually trigger a build on GCB, run:
# gcloud builds submit --config cloudbuild-sync-and-tag.yaml --substitutions TAG_NAME=[TAG] ..
#
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
#
# Note: to work around issue in Spinnaker's 'Deployment Manifest' stage,
# variable references must avoid the ${var} format. Valid formats include
# $var or ${"${var}"}. This file use the former. Since TAG_NAME is
# expanded in the copies sent to Spinnaker, we preserve the brackets around
# them for safe pattern matching during release.
# See https://github.com/spinnaker/spinnaker/issues/3028 for more information.
steps:
# Rsync the folder where deployment artifacts are uploaded.
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- storage
- rsync
- --delete-unmatched-destination-objects
- --recursive
- gs://$PROJECT_ID-deploy/${TAG_NAME}
- gs://$PROJECT_ID-deploy/live
- # Tag nomulus
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/nomulus:${TAG_NAME}
- gcr.io/$PROJECT_ID/nomulus:live
- # Tag proxy
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/proxy:${TAG_NAME}
- gcr.io/$PROJECT_ID/proxy:live
- # Tag nomulus tool
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/nomulus-tool:${TAG_NAME}
- gcr.io/$PROJECT_ID/nomulus-tool:live
# Tag builder
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/builder:${TAG_NAME}
- gcr.io/$PROJECT_ID/builder:live
# Update db_object_updater
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/db_object_updater:${TAG_NAME}
- gcr.io/$PROJECT_ID/db_object_updater:live
# Update prober cert updater
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/prober_cert_updater:${TAG_NAME}
- gcr.io/$PROJECT_ID/prober_cert_updater:live
# Update schema verifier
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/schema_verifier:${TAG_NAME}
- gcr.io/$PROJECT_ID/schema_verifier:live
# Update schema deployer
- name: 'gcr.io/$PROJECT_ID/builder:latest'
args:
- gcloud
- container
- images
- add-tag
- gcr.io/$PROJECT_ID/schema_deployer:${TAG_NAME}
- gcr.io/$PROJECT_ID/schema_deployer:live
timeout: 3600s
options:
machineType: 'E2_HIGHCPU_32'