-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
37 lines (37 loc) · 1015 Bytes
/
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
steps:
- name: "golang:1.22"
args: ["go", "get", "-d", "./..."]
env:
- "GO_VERSION=1.22"
- "GOPATH=/gopath"
volumes:
- name: "go"
path: "/gopath"
- name: "golang:1.22"
args: ["go", "build", "-o", "main", "."]
env:
- "GO_VERSION=1.22"
- "GOPATH=/gopath"
volumes:
- name: "go"
path: "/gopath"
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
timeout: "1600s"
env:
- "GO_VERSION=1.22"
- "GOPATH=/gopath"
volumes:
- name: "go"
path: "/gopath"
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: "bash"
args:
- "-c"
- |
versions=$(gcloud app versions list --service web-log --sort-by '~version' --format 'value(VERSION.ID)' | sed 1,10d)
for version in $versions; do
gcloud app versions delete $version --service web-log --quiet || echo "Error deleting version: $version"
done
options:
logging: CLOUD_LOGGING_ONLY