add docker latest tag for releases

This commit is contained in:
Sebastian Sdorra
2020-05-26 10:30:58 +02:00
parent 5d8c669b3a
commit d2067245ef
2 changed files with 31 additions and 1 deletions

View File

@@ -207,7 +207,6 @@
<configuration>
<repository>${docker.repository}</repository>
<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
<tag>${docker.tag}</tag>
<contextDirectory>target/build</contextDirectory>
</configuration>
<executions>
@@ -217,6 +216,20 @@
<goals>
<goal>build</goal>
</goals>
<configuration>
<tag>${docker.tag}</tag>
</configuration>
</execution>
<execution>
<id>build-latest</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<tag>latest</tag>
<skip>${docker.skipLatest}</skip>
</configuration>
</execution>
<execution>
<id>push</id>
@@ -224,6 +237,20 @@
<goals>
<goal>push</goal>
</goals>
<configuration>
<tag>${docker.tag}</tag>
</configuration>
</execution>
<execution>
<id>push-latest</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<tag>latest</tag>
<skip>${docker.skipLatest}</skip>
</configuration>
</execution>
</executions>
</plugin>

View File

@@ -24,6 +24,7 @@
def repository = "docker.io/scmmanager/scm-manager"
def version = project.version
def skipLatest = "false"
if (version.contains("SNAPSHOT")) {
repository = "docker.io/cloudogu/scm-manager"
@@ -36,7 +37,9 @@ if (version.contains("SNAPSHOT")) {
}
version = version.replace("SNAPSHOT", snapshotVersion)
skipLatest = "true"
}
project.properties.setProperty("docker.repository", repository)
project.properties.setProperty("docker.tag", version)
project.properties.setProperty("docker.skipLatest", skipLatest)