problem: tags all docker releases with latest

This commit is contained in:
Igor Artamonov
2020-06-29 23:25:37 -04:00
parent c2636cd81e
commit 493bea7b4d
2 changed files with 11 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ jobs:
- name: Upload to Docker
uses: eskatos/gradle-command-action@v1
with:
arguments: jib -Platest=true
arguments: jib
env:
DOCKER_KEY: ${{ secrets.DOCKER_KEY }}

View File

@@ -142,17 +142,22 @@ jib {
from {
}
to {
// execute with -Platest=true
// $ gradle jib -Platest=true
// by default publish as:
// dshackle:shapshot,
// dshackle:t<yyyyMMddHHmm>,
// dshackle:<versionFull> and
// dshackle:<versionMajor.versionMinor>
// dshackle:latest only when publishing first version with zero patch (ex. 1.2.0)
image = [
project.hasProperty('docker') ? project.property('docker') : 'emeraldpay',
'/dshackle:',
(project.hasProperty('latest') && project.property('latest') == 'true') ? 'latest' : 'snapshot'
'snapshot'
].join('')
tags = [project.version].with (true) {
if (!project.hasProperty('latest') || project.property('latest') != 'true') {
add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now())
if (project.version.toString().endsWith(".0")) {
add "latest"
}
add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now())
add project.version.toString().replaceAll('(\\d+\\.\\d+).+', '$1')
}
auth {