-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathTiltfile
26 lines (23 loc) · 1.13 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
# You will need to modify this file to enable Tilt live debugging
LOCAL_PATH = os.getenv("LOCAL_PATH", default='.')
NAMESPACE = os.getenv("NAMESPACE", default='default')
WAIT_TIMEOUT = os.getenv("WAIT_TIMEOUT", default='10m00s')
TYPE = os.getenv("TYPE", default='web')
allow_k8s_contexts('your-k8s-context') # CHANGEME - replace `your-k8s-context` with your targeted Kubernetes context
k8s_custom_deploy(
'java-function',
apply_cmd="tanzu apps workload apply -f config/workload.yaml --update-strategy replace --debug --live-update" +
" --local-path " + LOCAL_PATH +
" --namespace " + NAMESPACE +
" --wait-timeout " + WAIT_TIMEOUT +
" --type " + TYPE +
" --yes --output yaml",
delete_cmd="tanzu apps workload delete -f config/workload.yaml --namespace " + NAMESPACE + " --yes" ,
deps=['pom.xml', './target/classes'],
container_selector='workload',
live_update=[
sync('./target/classes', '/workspace')
]
)
k8s_resource('java-function', port_forwards=["8080:8080"],
extra_pod_selectors=[{'carto.run/workload-name': 'java-function', 'app.kubernetes.io/component': 'run'}])