summaryrefslogtreecommitdiffstats
path: root/deployment/docker/pom.xml
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/docker/pom.xml')
-rw-r--r--deployment/docker/pom.xml47
1 files changed, 45 insertions, 2 deletions
diff --git a/deployment/docker/pom.xml b/deployment/docker/pom.xml
index 4ab75507..c3cef0e3 100644
--- a/deployment/docker/pom.xml
+++ b/deployment/docker/pom.xml
@@ -31,7 +31,12 @@
<packaging>pom</packaging>
<properties>
- <docker.image.version>1.0.0</docker.image.version>
+ <docker.image.name>onap/cli</docker.image.name>
+ <maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
+ <docker.push.registry></docker.push.registry>
+ <skip.docker.build>true</skip.docker.build>
+ <skip.docker.tag>true</skip.docker.tag>
+ <skip.docker.push>true</skip.docker.push>
</properties>
<build>
@@ -42,8 +47,8 @@
<version>0.4.11</version>
<configuration>
<verbose>true</verbose>
+ <imageName>${docker.image.name}</imageName>
<serverId>docker-hub</serverId>
- <imageName>onap-cli</imageName>
<dockerDirectory>${basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
@@ -55,6 +60,44 @@
</resource>
</resources>
</configuration>
+ <executions>
+ <execution>
+ <id>build-image</id>
+ <phase>package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <configuration>
+ <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-image-timestamped-version</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image.name}</image>
+ <newName>${docker.push.registry}/${docker.image.name}:${project.version}-${maven.build.timestamp}</newName>
+ <pushImage>${skip.docker.push}</pushImage>
+ <skipDockerTag>${skip.docker.tag}</skipDockerTag>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-image-latest-version</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image.name}</image>
+ <newName>${docker.push.registry}/${docker.image.name}:latest</newName>
+ <pushImage>${skip.docker.push}</pushImage>
+ <skipDockerTag>${skip.docker.tag}</skipDockerTag>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>