-
Notifications
You must be signed in to change notification settings - Fork 103
/
Dispatchfile
43 lines (40 loc) · 1.33 KB
/
Dispatchfile
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
#!starlark
gitResource("git", url="$(context.git.url)", revision="$(context.git.commit)")
task("lint", inputs=["git"], steps=[k8s.corev1.Container(
name="lint",
image="golangci/golangci-lint:v1.23.8",
command=[ "golangci-lint", "run", "-v", "--timeout", "15m" ],
workingDir="/workspace/git",
resources = k8s.corev1.ResourceRequirements(
limits={
"cpu": k8s.resource_quantity("2000m"),
"memory": k8s.resource_quantity("7.5Gi")
},
requests={
"cpu": k8s.resource_quantity("2000m"),
"memory": k8s.resource_quantity("7.5Gi")
}
)
)])
task("integration-test", inputs=["git"], steps=[k8s.corev1.Container(
name="integration-test",
image="kudobuilder/golang:1.15",
command=[ "make", "integration-test" ],
env=[
k8s.corev1.EnvVar(name="INTEGRATION_OUTPUT_JUNIT", value="true"),
k8s.corev1.EnvVar(name="KUBEBUILDER_ATTACH_CONTROL_PLANE_OUTPUT", value="true")
],
workingDir="/workspace/git",
resources = k8s.corev1.ResourceRequirements(
limits={
"cpu": k8s.resource_quantity("2000m"),
"memory": k8s.resource_quantity("7.5Gi")
},
requests={
"cpu": k8s.resource_quantity("2000m"),
"memory": k8s.resource_quantity("7.5Gi")
}
)
)])
action(tasks=["lint", "integration-test"], on=push())
action(tasks=["lint", "integration-test"], on=pullRequest(chatops=["test"]))