forked from newrelic/nri-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
54 lines (43 loc) · 1.34 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
53
54
# -*- mode: Python -*-
# Settings and defaults.
project_name = 'nri-kubernetes'
cluster_name = 'minikube'
live_reload = True
# Only use explicitly allowed kubeconfigs as a safety measure.
allow_k8s_contexts(cluster_name)
# Building Docker image.
load('ext://restart_process', 'docker_build_with_restart')
if live_reload:
binary_name = '%s-linux' % project_name
# Building daemon binary locally.
local_resource(
'%s-binary' % project_name,
'GOOS=linux make compile',
deps=[
"./src",
"./internal",
"./cmd"
],
)
# Use custom Dockerfile for Tilt builds, which only takes locally built daemon binary for live reloading.
dockerfile = '''
FROM alpine:3.16.0
COPY %s /usr/local/bin/%s
''' % (binary_name, project_name)
docker_build_with_restart(
ref=project_name,
context='./bin',
dockerfile_contents=dockerfile,
entrypoint=[
"/usr/local/bin/%s" % project_name,
],
only=binary_name,
live_update=[
# Copy the binary so it gets restarted.
sync('bin/%s' % binary_name, '/usr/local/bin/%s' % project_name),
],
)
else:
docker_build(project_name, '.')
k8s_yaml(helm('./charts/newrelic-infrastructure', name='nr', values=['values-dev.yaml', 'values-local.yaml']))
k8s_yaml(helm('./charts/internal/e2e-resources', name='e2e-resources'))