From e67dcf4d6896bab7812d14970764268b023e5bf2 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 18 Nov 2023 13:25:46 +0100 Subject: [PATCH] (docker) Fix image tagging Should now be possible to push a tagged image with e.g. ./gradlew --info dockerPush -Pdocker-registry=registry.marginalia.nu -Pdocker-tag=test2 --- docker-service-with-dist.gradle | 6 +++++- docker-service.gradle | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docker-service-with-dist.gradle b/docker-service-with-dist.gradle index a5de41ae..aa97377f 100644 --- a/docker-service-with-dist.gradle +++ b/docker-service-with-dist.gradle @@ -46,7 +46,11 @@ dockerfileZip { docker { dockerfile = tasks.dockerFile.outputs.files.singleFile - name = (project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia')+'/'+application.applicationName+':'+(project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest') + var registry = project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia' + var tagName = project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest' + + name = registry+'/'+application.applicationName+':'+tagName + tag 'test', (registry+'/'+application.applicationName+':'+tagName) files tasks.distTar.outputs, \ project(':code:processes:crawling-process').distTar.outputs, \ diff --git a/docker-service.gradle b/docker-service.gradle index 4d53fc5a..64055ce9 100644 --- a/docker-service.gradle +++ b/docker-service.gradle @@ -35,7 +35,12 @@ dockerfileZip { docker { dockerfile = tasks.dockerFile.outputs.files.singleFile - name = (project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia')+'/'+application.applicationName+':' + (project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest') + var registry = project.hasProperty('docker-registry') ? project.property('docker-registry') : 'marginalia' + var tagName = project.hasProperty('docker-tag') ? project.property('docker-tag') : 'latest' + + name = registry+'/'+application.applicationName+':'+tagName + tag 'test', (registry+'/'+application.applicationName+':'+tagName) + files tasks.distTar.outputs dependsOn tasks.distTar }