Hot Reload feature for OCI Functions local development with Fn Server#714
Hot Reload feature for OCI Functions local development with Fn Server#714
Conversation
| } | ||
|
|
||
| fd, err := ioutil.TempFile(dir, "Dockerfile") | ||
| fd, err := ioutil.TempFile(dir, "Dockerfile-fn-tmp") |
There was a problem hiding this comment.
changed the temp file name to be more specific so that "fn watch" will ignore this file if it got changed by "fn deploy"
48e0f83 to
c14e622
Compare
c817de3 to
0b4c1c6
Compare
bf47f39 to
c8f66bc
Compare
abf98cb to
ac638c9
Compare
ac638c9 to
a94aa29
Compare
| } | ||
|
|
||
| func runFnDeployLocal(ctx context.Context, dir string, appName string) error { | ||
| cmd := exec.CommandContext(ctx, "fn", "deploy", "--app", appName, "--local", "--no-bump") |
There was a problem hiding this comment.
Looks like this step depends on the fn binary available on PATH. It may not be same binary user used to start watch. Would it be safe to use os.Executable() so watch always use the same exact CLI instance that started it?
| Value: defaultWatchDebounce, | ||
| Destination: &cmd.debounce, | ||
| }, | ||
| cli.StringSliceFlag{ |
There was a problem hiding this comment.
The help text says --ignore matches path segments it also gives --ignore '*.log' as an example, but the implementation only check
exact segment equality (s == p), or
filepath.Match
we could have some issue here for the nested log files.
There was a problem hiding this comment.
✅ fixed and added test case
| ### Ignoring paths | ||
| `fn watch` ignores these directories by default: | ||
|
|
||
| - `.git`, `.fn`, `node_modules`, `target`, `dist`, `vendor`, `Dockerfile-fn-temp*` |
There was a problem hiding this comment.
it should be Dockerfile-fn-tmp*
| This watches the current directory recursively and triggers: | ||
|
|
||
| ```sh | ||
| fn deploy --app <app> --local |
There was a problem hiding this comment.
should we also add --no-bump here?
fn deploy --app --local --no-bump
Hot Reload feature for OCI Functions local development with Fn Server