-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Tiltfile
120 lines (113 loc) · 2.71 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!python
# version_settings() enforces a minimum Tilt version
# https://docs.tilt.dev/api.html#api.version_settings
version_settings(constraint='>=0.33.20')
secret_settings(disable_scrub=True)
config.define_bool("lexbox-api-local")
config.define_bool("prod-ui-build")
cfg = config.parse()
forward_lexbox = not cfg.get("lexbox-api-local", False)
prod_ui_build = cfg.get("prod-ui-build", False)
docker_build(
'local-dev-init',
'data'
)
docker_build(
'ghcr.io/sillsdev/lexbox-api',
context='backend',
dockerfile='./backend/LexBoxApi/dev.Dockerfile',
only=['.'],
ignore=['FwHeadless'],
live_update=[
sync('backend', '/src/backend')
]
)
docker_build(
'ghcr.io/sillsdev/lexbox-fw-headless',
context='backend',
dockerfile='./backend/FwHeadless/dev.Dockerfile',
only=['.'],
ignore=['LexBoxApi', '**/Mercurial', '**/MercurialExtensions'],
live_update=[
sync('backend', '/src/backend')
]
)
if prod_ui_build:
docker_build(
'ghcr.io/sillsdev/lexbox-ui',
context='frontend',
dockerfile='./frontend/Dockerfile',
only=['.']
)
else:
docker_build(
'ghcr.io/sillsdev/lexbox-ui',
context='frontend',
dockerfile='./frontend/dev.Dockerfile',
only=['.'],
live_update=[
sync('frontend', '/app'),
]
)
docker_build(
'ghcr.io/sillsdev/lexbox-hgweb',
context='hgweb',
dockerfile='./hgweb/Dockerfile',
only=['.'],
build_args={"APP_VERSION": "dockerDev"},
live_update=[
sync('hgweb/repos', '/var/hg/repos'),
]
)
k8s_yaml(kustomize('./deployment/local-dev'))
allow_k8s_contexts('docker-desktop')
lexbox_ports = [
port_forward(1080, name='maildev'),
port_forward(18888, name='aspire'),
port_forward(4318, name='otel'),
port_forward(4317, name='otel-grpc')
]
if forward_lexbox:
lexbox_ports = [port_forward(5158, name='lexbox-api', link_path='/api/swagger')] + lexbox_ports
k8s_resource(
'lexbox',
labels=['app'],
resource_deps=['db'],
port_forwards=lexbox_ports
)
k8s_resource(
'ui',
labels=['app'],
links=[link('http://localhost', 'ui')]
)
k8s_resource(
'fw-headless',
labels=['app'],
resource_deps=['db'],
port_forwards=[
port_forward(5275, 80, name='fw-headless')
]
)
k8s_resource(
'hg',
labels=['app'],
port_forwards=[
port_forward(8088, name='hg'),
port_forward(8034, 80, name='hg-resumable'),
]
)
k8s_resource(
'db',
port_forwards=[
port_forward(5433, 5432, name='db'),
],
labels=["db"]
)
k8s_resource(
'pgadmin',
resource_deps=['db'],
port_forwards=[
port_forward(4810, name='pgadmin'),
],
labels=['db']
)