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

Strip multiple strings or, ideally, regex or glob from manual sync destination #9325

Open
simonstratmann opened this issue Feb 24, 2024 · 0 comments

Comments

@simonstratmann
Copy link

simonstratmann commented Feb 24, 2024

I have this sync configuration in my skaffold.yml:

      sync:
        hooks:
          before:
            - container:
                command: ["mkdir", "/test"]
        manual:
          - src: "*/target/classes/**/*.class"
            dest: "/test/"

A file moduleA/target/classes/A.class is copied to /test/moduleA/target/classes/A.class and a file moduleB/target/classes/B.class is copied to /test/moduleB/target/classes/B.class.

To keep the package structure for java intact they would need to be copied to /test/classes/A.class and /test/classes/B.class.

This seems to be impossible without adding an entry to the list for each submodule. It would be great if the strip value could be a regex or glob. That way the sync definition could be the same no matter in which project it's used and wouldn't need to be adapted if new modules are added.

It could look like this:

      sync:
        hooks:
          before:
            - container:
                command: ["mkdir", "/test"]
        manual:
          - src: "*/target/classes/**/*.class"
            dest: "/test/"
            strip: ".*/target/classes/"

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

No branches or pull requests

1 participant