-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync map can be inferred from artifact Dockerfile #1166
Comments
@r2d4 For docker, this is a pretty good idea. But what about the other artifact types here? I guess the whole concept of sync does not really make sense for |
Sync works for all artifact types actually. Internally each builder provides a dependency map of files for the watch controller. Docker does that by parsing the dockerfile, bazel runs a bazel query, and I’m not sure what the jib implementation is. Sync actually only works on the files in that list anyways. The syntax has much room for improvement though. |
Sure, sync works for all artifact types. Sorry for being so unclear about this here. Maybe this is too detailed now, but I also have a question about the tradeoffs for an implementation.
|
The new signature would be
The degenerate case could be to just assume that the source matches the destination. It does seem like there's some a little too much magic going on though. |
We already parse the source in a dockerfile's COPY and ADD, but we should also capture the destination.
So that instead of writing this:
Users could write this
However, there are many corner cases to watch out for. COPY can take multiple arguments to copy to the same destination folder, and there are rules of when the destination must be inferred as a directory or not.
Overlapping copies may be another corner case. Ultimately I think it will need to be modeled as a map of source files to possibly multiple locations.
Different artifact types can also provide different hints on how to fill in the sync map.
The text was updated successfully, but these errors were encountered: