-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTiltfile
74 lines (63 loc) · 1.67 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# For more on Extensions, see: https://docs.tilt.dev/extensions.html
load('ext://restart_process', 'docker_build_with_restart')
load('ext://helm_remote', 'helm_remote')
load('ext://namespace', 'namespace_create', 'namespace_inject')
namespace_create('internal')
compile_cmd = 'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X main.APIVersion=development -X main.Environment=development" -o build/api ./cmd/main.go'
# Compile locally and push to docker
local_resource(
'go-compile',
compile_cmd,
deps=['./cmd/main.go', './'],
ignore=['./build'],
auto_init=False,
labels=['api']
)
docker_build_with_restart(
'social-graph-api-image',
'.',
entrypoint=['/app/build/api'],
dockerfile='./Dockerfile.tilt',
only=[
'./build',
'./',
],
live_update=[
sync('./build', '/app/build'),
sync('./', '/app/'),
],
)
k8s_yaml('./infra/service/k8s.yml')
k8s_resource('social-graph-api',
auto_init=False,
port_forwards=['3010:3010', '3011:3011'],
resource_deps=['go-compile'],
links=['neo4j-standalone'],
labels=['api'],
)
helm_remote(
'nginx-ingress',
repo_name='nginx-stable',
repo_url='https://helm.nginx.com/stable',
namespace='internal',
set=['controller.metrics.enabled=true', 'controller.metrics.serviceMonitor=true']
)
k8s_resource(
'nginx-ingress-nginx-ingress',
port_forwards=['9113:9113'],
)
k8s_yaml('./infra/service/ingress.yml')
# Neo4j using Helm
helm_remote(
'neo4j-standalone',
repo_name='neo4j',
repo_url='https://helm.neo4j.com/neo4j/',
values=['./infra/database/values.yaml'],
namespace='internal'
)
k8s_resource(
'neo4j-standalone',
auto_init=False,
port_forwards=['7474:7474'],
labels=['neo4j']
)