(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
This commit is contained in:
Viktor Lofgren 2023-11-18 13:25:46 +01:00
parent dd9406d0ac
commit e67dcf4d68
2 changed files with 11 additions and 2 deletions

View File

@ -46,7 +46,11 @@ dockerfileZip {
docker { docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile 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, \ files tasks.distTar.outputs, \
project(':code:processes:crawling-process').distTar.outputs, \ project(':code:processes:crawling-process').distTar.outputs, \

View File

@ -35,7 +35,12 @@ dockerfileZip {
docker { docker {
dockerfile = tasks.dockerFile.outputs.files.singleFile 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 files tasks.distTar.outputs
dependsOn tasks.distTar dependsOn tasks.distTar
} }