aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/docker
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/docker')
-rw-r--r--deployment/docker/pom.xml47
-rw-r--r--deployment/docker/src/main/docker/Dockerfile2
2 files changed, 46 insertions, 3 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>
diff --git a/deployment/docker/src/main/docker/Dockerfile b/deployment/docker/src/main/docker/Dockerfile
index e59789bf..06c266c1 100644
--- a/deployment/docker/src/main/docker/Dockerfile
+++ b/deployment/docker/src/main/docker/Dockerfile
@@ -16,4 +16,4 @@ RUN ln ./bin/onap.sh /usr/sbin/onap
ENTRYPOINT /bin/bash
-RUN echo ONAP CLI successfully installed !! \ No newline at end of file
+RUN echo ONAP CLI docker successfully created !! \ No newline at end of file