GoogleContainerTools / GoogleContainerTools/skaffold

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

Open
#9,325 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

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/"

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.