Implement --watch for localrun with cancellation support
Motivation and Context
1) Implements faas-cli local-run -- watch and related to fixes in #969 which were for faas-cli up --watch
2) Implements --publish flag for up, so that up can be used with --platforms and for faster builds when iterating.
How Has This Been Tested?
This commit adds --watch support to localrun by using a context to cancel and remove any running container when a change is detected.
watchLoop has been updated to support a context.
Tested with VSCode - I suggest turning auto-save off when using this feature.
Tested again with faas-cli up to make sure there was no regression:
Description
Implement --watch for localrun with cancellation support
Motivation and Context
1) Implements
faas-cli local-run -- watch
and related to fixes in #969 which were forfaas-cli up --watch
2) Implements--publish
flag forup
, so thatup
can be used with--platforms
and for faster builds when iterating.How Has This Been Tested?
This commit adds --watch support to localrun by using a context to cancel and remove any running container when a change is detected.
watchLoop has been updated to support a context.
Tested with VSCode - I suggest turning auto-save off when using this feature.
Tested again with faas-cli up to make sure there was no regression:
https://asciinema.org/a/594072
Types of changes