GoogleContainerTools / GoogleContainerTools/skaffold

`init` should detect and configure Java multimodule projects for Buildpacks

Open
#4,417 1 comment 3 reactions 0 assignees View on GitHub
area/init area/init-analyze build/buildpacks kind/feature-request priority/blocked
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Information

This is a follow-up to #4167, and GoogleCloudPlatform/buildpacks#57.

Invoking `skaffold init` within a multi-module Java project should ideally produce several artifacts, with but with the context set to the root of the multimodule build and `GOOGLE_BUILDABLE` set for each of the different projects.

But currently in the cloud-code-samples - java-guestbook](https://github.com/GoogleCloudPlatform/cloud-code-samples/tree/master/java/java-guestbook), we get the following result:
```yaml
artifacts:
- image: java-guestbook-backend
context: backend
buildpacks:
builder: gcr.io/buildpacks/builder:v1
- image: java-guestbook-frontend
context: frontend
buildpacks:
builder: gcr.io/buildpacks/builder:v1
```

This configuration works for this particular project as the `frontend` and `backend` projects are completely standalone. But if they had a common library, then this setup would break.

Instead `init` should generate something like:
```yaml
artifacts:
- image: java-guestbook-backend
context: .
buildpacks:
builder: gcr.io/buildpacks/builder:v1
env:
- GOOGLE_BUILDABLE=backend
- image: java-guestbook-frontend
context: frontend
buildpacks:
builder: gcr.io/buildpacks/builder:v1
env:
- GOOGLE_BUILDABLE=frontend
```

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.