You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to improve the tilt args management system with an update function
Current Behavior
Today's api currently only have either full set with tilt args <ARGUMENTS> or full edit with vim with tilt args
Why Do You Want This?
I'm currently working on implementing tilt local environment for our developers. As part of the experience there are two extra features we wanted to accomplish:
An image type selector for each service
Each service can be run with either a Remote image based on our develop branch or an image built locally
Benefits mainly setup efforts - because by default we use our Remote images so no source code is needed on the first run
Java Composite build selector
Our backend is Java so another request was to enable composite build with a button similarly to IntelliJ
Our solution was to leverage tilt args and the extension UIButton. To accomplish that we added the following custom code to help us update the args dynamically:
def get_config_args():
return cfg.get("args") or []
def get_tilt_args_dict():
args = get_config_args()
argsDict = {}
for arg in args:
argParts = arg.split("=")
name = argParts[0]
value = argParts[1]
argsDict[name] = value
return argsDict
def convert_args_dict_to_args_command(argsDict):
command = "tilt args"
for argName, value in argsDict.items():
command += " " + argName + "=" + value
return command
def get_replace_tilt_arg_value_command(argName, value):
argsDict = get_tilt_args_dict()
argsDict[argName] = value
return convert_args_dict_to_args_command(argsDict)
service_core_enabled_arg_name = self["name"] + '-CoreComposite'
command = get_replace_tilt_arg_value_command(service_core_enabled_arg_name, "$COMPOSITE")
cmd_button(
self["name"] + "-core-composite",
argv=["sh", "-c", command],
resource=self["auto_compile_resource_name"],
icon_name='developer_board',
text='Composite Build Selector - Press to apply changes',
inputs=[
bool_input(name='COMPOSITE', true_string='true', false_string='false', label='Composite Build With Core'),
],
)
As you can see the custom code could have been shorten if tilt args had an update function.
After updating the args we can use the argument to change the way we build our service.
Providing an image of the final button
The text was updated successfully, but these errors were encountered:
Describe the Feature You Want
I would like to improve the tilt args management system with an update function
Current Behavior
Today's api currently only have either full set with
tilt args <ARGUMENTS>
or full edit with vim withtilt args
Why Do You Want This?
I'm currently working on implementing tilt local environment for our developers. As part of the experience there are two extra features we wanted to accomplish:
Our solution was to leverage tilt args and the extension UIButton. To accomplish that we added the following custom code to help us update the args dynamically:
As you can see the custom code could have been shorten if
tilt args
had an update function.After updating the args we can use the argument to change the way we build our service.
Providing an image of the final button
![image](https://private-user-images.githubusercontent.com/86613414/243786360-2c4f766d-7b9d-4dbc-9de6-6071cf0593a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2OTExNzIsIm5iZiI6MTcxOTY5MDg3MiwicGF0aCI6Ii84NjYxMzQxNC8yNDM3ODYzNjAtMmM0Zjc2NmQtN2I5ZC00ZGJjLTlkZTYtNjA3MWNmMDU5M2E0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDE5NTQzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJhNzcwMGU3YjNmNWZjOWZmY2FhM2UzYmRjYmU5YmMyZDAzZWYwM2QyZjMyZWMzODVlYmNkM2ViYmEwOWZhODQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.KSYTs0Szovf13PYl1wqieXiao-Zim0ghAKZfN7H8J9c)
The text was updated successfully, but these errors were encountered: