Tilefile watches for changes in ytt templates

- When using `local()` in the Tiltfile it will not know
  to watch those files for changes, so each time we use
  `local()` we now also use `watch_file()`
- As a result, editing a ytt template file now causes
  an immediate `kubectl apply` of the results
This commit is contained in:
Ryan Richard 2020-10-14 16:21:40 -07:00
parent cd970616da
commit 84a0084703

View File

@ -24,6 +24,8 @@ local_resource(
# Render the Dex installation manifest using ytt. # Render the Dex installation manifest using ytt.
k8s_yaml(local(['ytt','--file', '../../../test/deploy/dex'])) k8s_yaml(local(['ytt','--file', '../../../test/deploy/dex']))
# Tell tilt to watch all of those files for changes.
watch_file('../../../test/deploy/dex')
# Collect all the deployed Dex resources under a "dex" resource tab. # Collect all the deployed Dex resources under a "dex" resource tab.
k8s_resource( k8s_resource(
@ -54,6 +56,8 @@ k8s_yaml(local([
'--data-value', 'image_repo=image/local-user-auth', '--data-value', 'image_repo=image/local-user-auth',
'--data-value', 'image_tag=tilt-dev', '--data-value', 'image_tag=tilt-dev',
])) ]))
# Tell tilt to watch all of those files for changes.
watch_file('../../../deploy/local-user-authenticator')
# Collect all the deployed local-user-authenticator resources under a "local-user-auth" resource tab. # Collect all the deployed local-user-authenticator resources under a "local-user-auth" resource tab.
k8s_resource( k8s_resource(
@ -91,6 +95,8 @@ k8s_yaml(local([
'--data-value-yaml', 'replicas=1', '--data-value-yaml', 'replicas=1',
'--data-value-yaml', 'service_nodeport_port=31234', '--data-value-yaml', 'service_nodeport_port=31234',
])) ]))
# Tell tilt to watch all of those files for changes.
watch_file('../../../deploy/supervisor')
# Collect all the deployed supervisor resources under a "supervisor" resource tab. # Collect all the deployed supervisor resources under a "supervisor" resource tab.
k8s_resource( k8s_resource(
@ -131,6 +137,8 @@ k8s_yaml(local([
'--data-value discovery_url=$(TERM=dumb kubectl cluster-info | awk \'/Kubernetes master/ {print $NF}\') ' + '--data-value discovery_url=$(TERM=dumb kubectl cluster-info | awk \'/Kubernetes master/ {print $NF}\') ' +
'--data-value-yaml replicas=1', '--data-value-yaml replicas=1',
])) ]))
# Tell tilt to watch all of those files for changes.
watch_file('../../../deploy/concierge')
# Collect all the deployed local-user-authenticator resources under a "concierge" resource tab. # Collect all the deployed local-user-authenticator resources under a "concierge" resource tab.
k8s_resource( k8s_resource(