jib icon indicating copy to clipboard operation
jib copied to clipboard

Enable lazy evaluation of jib.container.creationTime and jib.container.filesModificationTime

Open creckord opened this issue 3 years ago • 3 comments

Similar to what #2727 did for image name and tags, it would be great to be able to have lazy evaluation for creationTime and filesModificationTime, e.g. to set times to the latest commit time provided by gradle-git-properties (see also #2317).

Currently, this is not easily possible, since the value in the plugin config is eagerly bound before the git properties are set. I.e. this does not work:

jib {
    container {
        creationTime = project.provider { project.ext.git['git.commit.time'] }
    }
}
tasks.jib.dependsOn generateGitProperties
tasks.jibBuildTar.dependsOn generateGitProperties
tasks.jibDockerBuild.dependsOn generateGitProperties

creckord avatar Jul 19 '22 11:07 creckord

Thank you for creating this issue and opening the PR @creckord! As mentioned in the PR, we will wait for the CLA to signed to review your contribution.

mpeddada1 avatar Jul 22 '22 14:07 mpeddada1

Just a quick life sign - it took a bit for the CLA to pass our legal, but I have that now, right in time for my 3-week vacation in offline land. I'll fix the open issues in the PR when I'm back.

creckord avatar Aug 12 '22 18:08 creckord

Thank you!

elefeint avatar Aug 12 '22 18:08 elefeint

jib-gradle-plugin 3.3.1 has been released with this feature. Thanks again for your contribution!

emmileaf avatar Oct 28 '22 20:10 emmileaf