This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDispatchfile
64 lines (57 loc) · 2.61 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!mesosphere/dispatch-starlark:v0.6
# vi:syntax=python
load("github.com/mesosphere/dispatch-catalog/starlark/stable/pipeline@0.0.7", "cron")
load("github.com/mesosphere/cluster-claim-controller/starlark/claim@master",
"make_kind_cluster_claim", "fetch_kubeconfig", "release_claim")
load("github.com/mesosphere/dispatch-tasks/bump_charts/bump_charts@master", "bump_charts")
load("github.com/mesosphere/dispatch-catalog/starlark/stable/pipeline@0.0.4", "gitResource", "pullRequest", "push", "volume", "resourceVar", "secretVar")
git = "src-git"
gitResource(git, url="$(context.git.url)", revision="$(context.git.commit)")
cluster_name = "kubeaddons"
kind_cluster=make_kind_cluster_claim(cluster_name, deps=[git])
task("integration-test", inputs=[git],
deps=[kind_cluster],
steps=[
fetch_kubeconfig(cluster_name, git, name="fetch-config"),
k8s.corev1.Container(
name = "integration-tester",
workingDir = "/workspace/{}/".format(git),
image = "mesosphere/kubeaddons-ci:latest",
command = ["/bin/bash", "-c"],
args = [
"""
set -euo pipefail
export GIT_TERMINAL_PROMPT=1
export GOPRIVATE=github.com/mesosphere/kubeaddons
ssh-keyscan -t rsa github.com > /etc/ssh/known_hosts
git config --global url."https://$GITHUB_TOKEN:@github.com/".insteadOf "https://github.com/"
echo $PWD
ls -a
make kind-test
"""
],
resources = k8s.corev1.ResourceRequirements(
limits = {
"cpu": k8s.resource_quantity("8000m"),
"memory": k8s.resource_quantity("6Gi")
},
requests = {
"cpu": k8s.resource_quantity("500m"),
"memory": k8s.resource_quantity("1Gi")
}
),
env=[k8s.corev1.EnvVar(name="GITHUB_TOKEN",
valueFrom=secretVar("d2iq-dispatch-github-personal-access-token",
"GITHUB_TOKEN"))
]
)
]
)
kind_cleanup = release_claim(kind_cluster, "integration-test")
do_bump_charts = bump_charts(repo_name="kubeaddons-enterprise", task_name="bump-charts")
#Robot Actions
action(name="bump-charts", on=cron(schedule="0 3 * * 5"), tasks=[do_bump_charts])
#PRs
action(tasks=["integration-test", kind_cleanup], on=pullRequest())
#Chatops Actions
action(tasks=["integration-test", kind_cleanup], on=pullRequest(chatops=["test"]))