mirrored from https://skia.googlesource.com/buildbot
/
vm.go
54 lines (46 loc) · 1.3 KB
/
vm.go
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
package main
import (
"path"
"runtime"
"cloud.google.com/go/bigtable"
"cloud.google.com/go/datastore"
"go.skia.org/infra/go/gce"
"go.skia.org/infra/go/gce/server"
)
func StatusBase(name string) *gce.Instance {
vm := server.Server20170928(name)
vm.DataDisks[0].SizeGb = 100
vm.DataDisks[0].Type = gce.DISK_TYPE_PERSISTENT_STANDARD
vm.Metadata["owner_primary"] = "borenet"
vm.Metadata["owner_secondary"] = "kjlubick"
vm.Scopes = append(vm.Scopes,
bigtable.Scope,
datastore.ScopeDatastore,
)
_, filename, _, _ := runtime.Caller(0)
dir := path.Dir(filename)
vm.StartupScript = path.Join(dir, "startup-script.sh")
return vm
}
func StatusProd() *gce.Instance {
vm := StatusBase("skia-status")
vm.ServiceAccount = "status@skia-buildbots.google.com.iam.gserviceaccount.com"
return vm
}
func StatusInternal() *gce.Instance {
vm := StatusBase("skia-status-internal")
vm.ServiceAccount = "status-internal@skia-buildbots.google.com.iam.gserviceaccount.com"
return vm
}
func StatusStaging() *gce.Instance {
vm := StatusBase("skia-status-staging")
vm.ServiceAccount = "status@skia-buildbots.google.com.iam.gserviceaccount.com"
return vm
}
func main() {
server.Main(gce.ZONE_DEFAULT, map[string]*gce.Instance{
"prod": StatusProd(),
"internal": StatusInternal(),
"staging": StatusStaging(),
})
}