forked from GoogleCloudPlatform/compute-image-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli_tools_cloudbuild.yaml
134 lines (124 loc) · 7.58 KB
/
cli_tools_cloudbuild.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
timeout: 4500s
options:
env:
- GO111MODULE=auto
- GOPROXY=https://proxy.golang.org
volumes:
- name: go-pkg
path: /go/pkg
- name: go-src
path: /go/src
substitutions:
_RELEASE: 'latest'
steps:
# Build gce_image_publish.
- name: 'golang'
dir: 'cli_tools/gce_image_publish'
args: ['go', 'build', '-o=/workspace/linux/gce_image_publish']
env: ['CGO_ENABLED=0']
- name: 'golang'
dir: 'cli_tools/gce_image_publish'
args: ['go', 'build', '-o=/workspace/windows/gce_image_publish.exe']
env: ['GOOS=windows']
- name: 'golang'
dir: 'cli_tools/gce_image_publish'
args: ['go', 'build', '-o=/workspace/darwin/gce_image_publish']
env: ['GOOS=darwin']
- name: 'gcr.io/kaniko-project/executor:v1.0.0'
args:
- --destination=gcr.io/$PROJECT_ID/gce_image_publish:$_RELEASE
- --destination=gcr.io/$PROJECT_ID/gce_image_publish:$COMMIT_SHA
- --context=/workspace
- --dockerfile=gce_image_publish.Dockerfile
# Build gce_export.
- name: 'golang'
dir: 'cli_tools/gce_export'
args: ['go', 'build', '-o=/workspace/linux/gce_export']
env: ['CGO_ENABLED=0']
- name: 'golang'
dir: 'cli_tools/gce_export'
args: ['go', 'build', '-o=/workspace/windows/gce_export']
env: ['GOOS=windows']
- name: 'gcr.io/kaniko-project/executor:v1.0.0'
args:
- --destination=gcr.io/$PROJECT_ID/gce_export:$_RELEASE
- --destination=gcr.io/$PROJECT_ID/gce_export:$COMMIT_SHA
- --context=/workspace
- --dockerfile=gce_export.Dockerfile
# Build gce_windows_upgrade.
- name: 'golang'
dir: 'cli_tools/gce_windows_upgrade'
args: ['go', 'build', '-o=/workspace/linux/gce_windows_upgrade']
env: ['CGO_ENABLED=0']
- name: 'gcr.io/kaniko-project/executor:v1.1.0'
args:
- --destination=gcr.io/$PROJECT_ID/gce_windows_upgrade:$_RELEASE
- --destination=gcr.io/$PROJECT_ID/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-central1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-west1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-west1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-west2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-west2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-west3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-west3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-west4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-west4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=us-east4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=us-east4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=northamerica-northeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=northamerica-northeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=southamerica-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=southamerica-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-north1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-north1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-west1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-west1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-west2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-west2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-west3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-west3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-west4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-west4-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=europe-west6-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=europe-west6-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-east1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-east2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-east2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-northeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-northeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-northeast2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-northeast2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-northeast3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-northeast3-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-south1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-south1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-southeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-southeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=asia-southeast2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=asia-southeast2-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --destination=australia-southeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$_RELEASE
- --destination=australia-southeast1-docker.pkg.dev/$PROJECT_ID/wrappers/gce_windows_upgrade:$COMMIT_SHA
- --context=/workspace
- --dockerfile=gce_windows_upgrade.Dockerfile
# Copy Linux binaries to GCS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/linux/*', 'gs://$PROJECT_ID/$_RELEASE/linux/']
# Copy Windows binaries to GCS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/windows/*', 'gs://$PROJECT_ID/$_RELEASE/windows/']
# Copy OSX binaries to GCS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', '/workspace/darwin/*', 'gs://$PROJECT_ID/$_RELEASE/darwin/']
# Make binaries world-readable.
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-m', 'acl', '-r', 'ch', '-u', 'AllUsers:R', 'gs://$PROJECT_ID/$_RELEASE/*']