-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
jib doesn't update images when included Gradle projects change #1745
Comments
Any chance you give provide a simple project on which to test this out? |
I suspect that you could not be triggering a new build of Usually for multiproject builds, I expect to see the |
@loosebazooka composite builds improve the workflow of working with interacting projects, e.g.
It may well be something problematic in our projects, but as a starting point it would be good to know if it's been tested against composite builds. |
@loosebazooka as for sample projects, Gradle has a few composite build samples on GitHub to bootstrap with. If that's not good enough, let me know and I'll put something together. |
@emersonf, right, I was just curious why you were using it. We sometimes encounter users making confusion decisions, it's a little presumptuous of me to make that assumption wholesale, but we usually need to make sure people know what they're doing before investing time on strange issues.
|
So we definitely have an issue with Can you run your build with |
So I followed this process...
Here's the output when the Gradle command is
Here's the output when the Gradle command is
Happy diffing. |
So I'm experiencing a slightly different result. So I've just modified the basic project from the examples: https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/compositeBuilds/basic/groovy I just add the
and I get this output
And as you can see the difference between your build and mine is that the subproject dependencies are being built as full jars (so jib can pick up any changes). Even just running What version of gradle are you using? Maybe this is a gradle issue? I'm on 5.4.1 |
@emersonf Any update here? |
@loosebazooka I haven't had time to try to continue evaluating, was planning to try again over the weekend. I'm on 5.4 as well. My (only) suspicion is that Spring Boot's Gradle plugin is futzing with JAR behaviour, so I'll dig into that in the near future. Feel free to tag this issue as blocked on me if that helps. |
I think I found the culprit, and it's not Spring. Our My guess is that If that's right, this could be a bigger issue, because it would affect all projects using Java Library plugins, irrespective of included builds. |
To add a bit more confusion to the scenario, it seems like I think we should ignore all that; it would help to figure out how to get |
For the record: The |
@emersonf, we haven't looked at this issue in a little because of some other things we're working on, but one temporary solution might be to put this in your build: tasks.all { task ->
if(task.name.startsWith('jib')) {
task.dependsOn project.tasks.jar // or project.tasks.assemble
}
} if you have an idea of the correct dependsOn, that would be a real help to us, we can then verify your suggestion and include it. |
I have a similar issue to #1776, where running From the logs, it seems the reason is that with the For reference, this is what I ended up adding in my tasks.matching {
it.name.startsWith('jib')
}.configureEach {
it.dependsOn tasks.named('assemble')
} |
Fixed by #2247 |
Description of the issue:
gradle jibDockerBuild
isn't creating new Docker images when code in Gradle included builds changes.For the time being, I'm calling
gradle build jibDockerBuild
to work around this but that's counter-intuitive.Expected behavior:
When code in an included build changes and
gradle jibDockerBuild
is re-run, a new image should be built containing the latest code from both the project and its included builds.Steps to reproduce:
Assume a composite Gradle build where an app's
build.gradle
declares a dependency on a library usingand its
settings.gradle
containssome-lib
and rungradle jibDockerBuild
on the app, the build fails, so I know the right library code is being compiled.some-lib
,jibDockerBuild
succeeds but the Docker image it constructs is identical to the one before the change, it just has a newLastTagTime
.gradle jibDockerBuild
, a new image is built, but it still executes oldsome-lib
code.some-lib.jar
in/apps/libs
, which isn't getting updated.gradle build
beforegradle jibDockerBuild
, the library is updated.Environment: macOS, JDK8, Gradle
jib-gradle-plugin
Configuration:The text was updated successfully, but these errors were encountered: