forked from GoogleCloudPlatform/compute-image-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
daisy_release_cloudbuild.yaml
89 lines (80 loc) · 4.42 KB
/
daisy_release_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
timeout: 900s
steps:
# Setup workspace
- name: 'alpine'
args: ['mkdir', '-p', './src/github.com/GoogleCloudPlatform/compute-image-tools']
- name: 'alpine'
args: ['mv', './daisy', './src/github.com/GoogleCloudPlatform/compute-image-tools/daisy']
- name: 'alpine'
args: ['mv', './cli_tools', './src/github.com/GoogleCloudPlatform/compute-image-tools/cli_tools']
- name: 'alpine'
args: ['mv', './go', './src/github.com/GoogleCloudPlatform/compute-image-tools/go']
- name: 'gcr.io/cloud-builders/go'
args: ['get', '-d', './src/github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/...']
env: ['GOPATH=./']
- name: 'gcr.io/cloud-builders/go'
args: ['get', '-d', './src/github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/...']
env: ['GOPATH=./', 'GOOS=windows']
# Build Linux binaries.
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=linux/daisy', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/daisy']
env: ['CGO_ENABLED=0']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=linux/gce_image_publish', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_image_publish']
env: ['CGO_ENABLED=0']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=linux/import_precheck', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/import_precheck']
env: ['CGO_ENABLED=0']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=linux/gce_vm_image_import', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_vm_image_import']
env: ['CGO_ENABLED=0']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=linux/gce_ovf_import', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_ovf_import']
env: ['CGO_ENABLED=0']
# Copy Linux binaries to GS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', './linux/*', 'gs://compute-image-tools/release/linux/']
# Build Linux containers.
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/daisy:release', '--tag=gcr.io/$PROJECT_ID/daisy:$COMMIT_SHA', '--file=Dockerfile.daisy', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_image_publish:release', '--tag=gcr.io/$PROJECT_ID/gce_image_publish:$COMMIT_SHA', '--file=Dockerfile.gce_image_publish', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_vm_image_import:release', '--tag=gcr.io/$PROJECT_ID/gce_vm_image_import:$COMMIT_SHA', '--file=Dockerfile.gce_vm_image_import', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/$PROJECT_ID/gce_ovf_import:release', '--tag=gcr.io/$PROJECT_ID/gce_ovf_import:$COMMIT_SHA', '--file=Dockerfile.gce_ovf_import', '.']
# Build Windows binaries.
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=windows/daisy.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/daisy']
env: ['GOOS=windows']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=windows/gce_image_publish.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_image_publish']
env: ['GOOS=windows']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=windows/import_precheck.exe', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/import_precheck']
env: ['GOOS=windows']
# Copy Windows binaries to GS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', './windows/*', 'gs://compute-image-tools/release/windows/']
# Build OSX binaries.
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=darwin/daisy', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/daisy']
env: ['GOOS=darwin']
- name: 'gcr.io/cloud-builders/go'
args: ['build', '-o=darwin/gce_image_publish', 'github.com/GoogleCloudPlatform/compute-image-tools/cli_tools/gce_image_publish']
env: ['GOOS=darwin']
# Copy OSX binaries to GS
- name: 'gcr.io/cloud-builders/gsutil'
args: ['cp', './darwin/*', 'gs://compute-image-tools/release/darwin/']
# Make binaries world-readable.
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-m', 'acl', '-r', 'ch', '-u', 'AllUsers:R', 'gs://compute-image-tools/release/*']
images:
- 'gcr.io/$PROJECT_ID/daisy:release'
- 'gcr.io/$PROJECT_ID/daisy:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/gce_image_publish:release'
- 'gcr.io/$PROJECT_ID/gce_image_publish:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/gce_vm_image_import:release'
- 'gcr.io/$PROJECT_ID/gce_vm_image_import:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/gce_ovf_import:release'
- 'gcr.io/$PROJECT_ID/gce_ovf_import:$COMMIT_SHA'