-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
44 lines (38 loc) · 902 Bytes
/
cloudbuild.yaml
File metadata and controls
44 lines (38 loc) · 902 Bytes
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
steps:
## Go build produces binary
## /workspace/yvr-io/gopath/bin/yvr-io
##
## Docker Image build copies
## - Certs
## - /workspace/yvr-io/gopath/bin/yvr-io -> /yvr-io
##
## Use dir: because we are not at the root of the git repo.
## `dir: yvr-io`
##
#CGO_ENABLED=0 go build -a -installsuffix cgo
- name: 'gcr.io/cloud-builders/go'
env:
- PROJECT_ROOT=yvr-io
- CGO_ENABLED=0
args:
- 'install'
- '-a'
- '-installsuffix'
- 'cgo'
- '.'
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
id: 'write'
args:
- '-c'
- |
cp /etc/ssl/certs/ca-certificates.crt .
cat > Dockerfile <<EOS
FROM scratch
ADD ca-certificates.crt /etc/ssl/certs/
ADD gopath/bin/yvr-io /
CMD ["/yvr-io"]
EOS
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '--tag=gcr.io/yvr-io/hello:$SHORT_SHA', '.']
images: ['gcr.io/yvr-io/hello:$SHORT_SHA']