GoogleContainerTools / GoogleContainerTools/jib
Split building from publishing in Gradle tasks (separate build and push)
- Dominant language
- Java
- Stars
- 14.5k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Description of the issue**:
jib, jibBuildTar and jibDockerBuild are all standalone tasks doing both the building and publishing. Expectation would rather be that those three tasks share a common tasks that takes care of the building while the three tasks then do the "publishing" to the desire target.
**Expected behavior**:
A shared build task should take care of:
- downloading base layer
- preparting the layers in the cache directory
- computing the image id and digest
Further the shared build task should have regular Gradle up-to-date checking to improve build performance, limiting the work of "jib" to a minimal in many cases.
**Motivation*
Motiviation from the change comes from two sides.
1. we would like to be able to follow Gradle conventions. Most notable have proper up-to-date checking.
2. we work with image id and digests to tag our images (and reuse in some further places). This in turn forces us to do both a jibBuildTar followed by jib to first get hold onto the imageId and digest.
Complicated it the second one that we seem to have an issue with reproducablity so that jibBuildTar and jib do not create the same images in the build. Mostly tracked that down, but not fully yet. Having the structure as above one the one side would make it easier to track such issues down (with Gradle up-to-date checking) and on the other side would avoid such redudant code execution in the first place.
Contributor guide
Assessment
This issue has not been assessed yet.