Skip to content

Commit

Permalink
Use dispatch 1.1.0-beta1 (#1475)
Browse files Browse the repository at this point in the history
* Second stab at dispatch

- rename Dispatchfile.cue to Dispatchfile
- run lint and integration-tests.
- rewrite in starlark
- add resource reservations and limits

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
  • Loading branch information
porridge committed May 5, 2020
1 parent 63c653a commit 1e7adc9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
43 changes: 43 additions & 0 deletions Dispatchfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.14",
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"]))
28 changes: 0 additions & 28 deletions Dispatchfile.cue

This file was deleted.

0 comments on commit 1e7adc9

Please sign in to comment.