envd icon indicating copy to clipboard operation
envd copied to clipboard

feat(lang): Support local-shell

Open gaocegege opened this issue 3 years ago • 4 comments

Description

It will be great to support running some shell scripts during the build process.

def get_kube_nodes(name):
    ip = local-shell("kubectl get nodes -o=jsonpath='{range .items[*]}{.metadata.name}{":"}{.status.addresses[?(@.type=="InternalIP")].address}{"\n"}{end}'")

Ref https://api.tilt.dev/core/cmd-v1alpha1.html#Cmd


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

gaocegege avatar Oct 13 '22 08:10 gaocegege

I think it can be done by https://github.com/tensorchord/envd/issues/825

kemingy avatar Oct 13 '22 08:10 kemingy

I think these are two different features. #825 provides CLI arguments in envd up.

gaocegege avatar Oct 13 '22 08:10 gaocegege

It's much more flexible to do it in a shell and pass the result as an argument. Also, it's easier to debug in the shell.

kemingy avatar Oct 13 '22 08:10 kemingy

I understand your opinion here.

gaocegege avatar Oct 13 '22 09:10 gaocegege