openfaas / faas-cli

Official CLI for OpenFaaS
https://www.openfaas.com/
Other
795 stars 226 forks source link

Feature: "watch" mode -> automatic build/push/deploy on save #472

Open alexellis opened 6 years ago

alexellis commented 6 years ago

Expected Behaviour

New feature: file-system watch mode will detect a change in a function handler folder and then automatically build/push/deploy the affected function.

This would be done via the existing OpenFaaS API meaning all backends are supported - faas-fargate, faas-swarm, faas-netes and openfaas-operator.

Similar things are done in entire projects such as skaffold from Google. I know Stefan @stefanprodan is a fan of this project. I believe Skaffold needs a Dockerfile in a set place, we can workaround this by using "faas-cli build --shrinkwrap" or maybe a combination of all of the above.

The basic idea is to allow a "watch" / auto-reloader experience for function development.

Thoughts?

alexellis commented 6 years ago

I was chatting to @johnmccabe about this, we're thinking of adding faas-cli up with an optional --watch flag which would be an alias for the whole workflow of build/push/deploy

alexellis commented 6 years ago

@johnmccabe how did the initial attempt go with this? How does Docker-Compose handle de-bounce?

johnmccabe commented 6 years ago

Initial PoC worked well, I'll pick this up after work tomorrow and get something pushed up for eyeballs.

alexellis commented 6 years ago

Awesome John.

alexellis commented 6 years ago

@johnmccabe do you still have work in progress for this?

johnmccabe commented 6 years ago

Yeah, needs dusted off and pushed (got side-tracked helping with the minikube stuff) - I can swing back round to this on Sunday after I get VMUG and PHP Scotland out of the way.

alexellis commented 5 years ago

Do you still have a local copy? Anything we should be aware of or watch for?