From 9f211232fdecddba1ea8253c6dd03b60398b5692 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Sun, 11 Aug 2019 21:27:39 -0400 Subject: [PATCH] solution: publish to docker with latest tag --- build.gradle | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index ac4121e9..3493125e 100644 --- a/build.gradle +++ b/build.gradle @@ -120,18 +120,19 @@ application { mainClassName = 'io.emeraldpay.dshackle.StarterKt' } -ext { - dockerTags = [project.version].with (true) { - add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now()) - } -} - jib { from { } to { image = 'emeraldpay/dshackle:snapshot' - tags = dockerTags + tags = [project.version].with (true) { + add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now()) + // execute with -Platest=true + // $ gradle jib -Platest=true + if (project.hasProperty('latest') && project.property('latest') == 'true') { + add "latest" + } + } } container { jvmFlags = [