Closed Vanderscycle closed 10 months ago
You can't call tiltfile functions from a shell script. Here's a good doc on tilt's execution model: https://docs.tilt.dev/controlloop
You can do this with the tiltfile API. For example for example, i have this in my tiltfile:
cmd_button(name='frontend-dev',
text='Frontend Dev',
icon_name='bolt',
location=location.NAV,
argv=['tilt', 'patch', 'tiltfile', '(Tiltfile)', '--patch', '{"spec": {"args": ["--frontend=dev"]}}'])
cmd_button(name='frontend-prod',
text='Frontend Prod',
icon_name='local_shipping',
location=location.NAV,
argv=['tilt', 'patch', 'tiltfile', '(Tiltfile)', '--patch', '{"spec": {"args": ["--frontend=prod"]}}'])
local_resource('choose-a-mode', ['echo', """Must specify 'tilt up -- --frontend=dev' or 'tilt up -- --frontend=prod'
Click the bolt for --frontend=dev.
Click the truck for --frontend=prod.
"""])
which toggles where it runs the frontend in a local_resource or remotely
Hey,
I love tilt, and I was hoping to use the ui to make small changes to the state of tilt without having to go back to the file. One example is to switch between localhost/infrastructure where one is dev and the other is running using all of the k8s manifets.
Its possible that I missed how to do it in the docs.