Skip to content
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: subtree sync needs documentation #1837

Closed
corneliusweig opened this issue Mar 19, 2019 · 14 comments
Closed

Sync: subtree sync needs documentation #1837

corneliusweig opened this issue Mar 19, 2019 · 14 comments

Comments

@corneliusweig
Copy link
Contributor

corneliusweig commented Mar 19, 2019

Information

PR #1813 introduced the triple-star syntax for the sync map:

sync:
  'foo/***/*.js': /usr/src/app/

Its purpose is to recreate the directory structure under foo at the destination (see also #1807).

This feature needs some documentation. But where should it be documented?

EDIT The syntax may be changed. See #1844 and #1847.

@balopat
Copy link
Contributor

balopat commented Mar 21, 2019

well - the best place would be https://skaffold.dev/docs/how-tos/filesync/ but it's lacking a bit of documentation still :)

@balopat
Copy link
Contributor

balopat commented Mar 21, 2019

Also, I'm not fully convinced about triple star just yet...it's so non-standard...not that globs have any kind of standard (especially with docker's lack of ability to do preserved subtrees moby/moby#15858), but I feel like we are adding to the confusion with triple star.

@corneliusweig corneliusweig changed the title Sync: triple-star syntax needs documentation Sync: subtree sync needs documentation Mar 21, 2019
@corneliusweig
Copy link
Contributor Author

Should be put on hold until #1844 is settled.

@tejal29
Copy link
Contributor

tejal29 commented Mar 21, 2019

@balopat dont' worry @corneliusweig is taking that in to consideration in the design proposal something we can discuss later.

@tejal29 tejal29 closed this as completed Mar 21, 2019
@tejal29 tejal29 reopened this Mar 21, 2019
@tejal29
Copy link
Contributor

tejal29 commented Mar 21, 2019

Sorry, closed by accident

@gaetansnl
Copy link

gaetansnl commented Mar 26, 2019

Is there a way to sync subtrees with v0.25.0 ?

@corneliusweig
Copy link
Contributor Author

corneliusweig commented Mar 26, 2019

Is there a way to sync subtrees with v0.25.0 ?

@pulse14 Yes, as of v0.25.0 with current master build you can do for example

sync:
  'src/***/*.py': dest/

This will sync all py-files below src and recreate the folder structure below src at dest. The syntax might change in future.

@evanpipta
Copy link

@corneliusweig That syntax does not work for me in v0.25.0, the files are all copied to the root of the dest folder without the folder structure preserved. Is there a separate issue open for this?

@gaetansnl
Copy link

gaetansnl commented Mar 26, 2019

I agree. I have 'packages/server/***/*.js': ./. The container workdir is /app/packages/server/.
When I edit packages/server/src/index.js it syncs it to /app/packages/server/index.js.
When I edit packages/server/src/somefolder/somefile.js it triggers a rebuild.
(I'm on windows)

@evanpipta
Copy link

@pulse14 @corneliusweig Nevermind, I see that the pull request to add *** was only merged after v0.25.0 was released. Maybe update your comment to say that you will be able to do that in the next release.

@corneliusweig
Copy link
Contributor Author

@747823 🤦‍♂️ you are right, sorry for that confusion!

@casret
Copy link

casret commented Apr 2, 2019

I'm really curious about what the use case is for the current way ** works? I just don't see when you would want to flatten out a directory like that.

@corneliusweig
Copy link
Contributor Author

corneliusweig commented Apr 5, 2019

@casret As discussed in #1844 the flattening will most likely be fixed with some other sync improvements 😉

corneliusweig referenced this issue Apr 8, 2019
Ignore best practices for npm and work without package-lock.json.
This file is ~300kb and should not bloat the skaffold repository.

Signed-off-by: Cornelius Weig <22861411+corneliusweig@users.noreply.github.com>
@corneliusweig
Copy link
Contributor Author

Superseded by #1994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants