This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTiltfile
52 lines (44 loc) · 1.86 KB
/
Tiltfile
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
# Allows for faster local builds that push into kube
local_resource(
'go-compile-controller',
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o manager main.go',
deps=["./main.go", "./api", "./controllers", "./internal"])
local_resource(
'go-compile-testserver',
'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -o mock-server tester/mockserver/main.go',
deps=["./tester/mockserver", "./tester/common"])
dev_dockerfile = """
# This is a super minimal image that just places the controller binary
# into place. This makes for much faster deployment cycles with local dev.
FROM alpine
WORKDIR /
COPY manager /manager .
ENTRYPOINT ["/manager"]
"""
docker_build('localhost:5000/monitoring-controller', '.',
dockerfile_contents=dev_dockerfile,
only=["./manager"])
httpmock_dockerfile = """
# This is a super minimal image that just places the controller binary
# into place. This makes for much faster deployment cycles with local dev.
FROM alpine
WORKDIR /
COPY mock-server /mock-server .
ENTRYPOINT ["/mock-server"]
"""
docker_build('localhost:5000/mock-server', '.',
dockerfile_contents=httpmock_dockerfile,
only=["./mock-server"])
k8s_yaml(kustomize('config/default'))
k8s_yaml('config/mockserver/install.yaml')
# Name is autogenerated, which is why its goofy.
# This allows you to `curl localhost:9090/metrics`
k8s_resource(workload='monitoring-controller-controller-manager', port_forwards=["9090:8080"])
k8s_resource(workload='mock-server', port_forwards=["9091:80"])
# Executes integration tests. This is currently manually triggered, but
# we may want it to watch the source area and build as it changes.
local_resource('test-runner',
cmd='go run tester/runner/*',
resource_deps=['monitoring-controller-controller-manager', 'mock-server'],
deps=["./tester/common", "./tester/runner"]
)