diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-08-09 09:28:19 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-08-09 11:47:01 +0530 |
commit | 0afd1a85db202e49d25b872722c08bd051f08037 (patch) | |
tree | f81bb6e33355fb6ef256d1707882bd79eb90fc02 /deployment/docker | |
parent | 8fa22677731f8227c7986f6848ef4bd45ecfab35 (diff) |
Enable docker push into nexus3
It adds required settings in pom.xml for
pushing the cli docker image into nexus
as part of mvn deploy phase.
CLI-26
Change-Id: I693593ad99f5761328bc0145649a6e54f7ab7b51
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'deployment/docker')
-rw-r--r-- | deployment/docker/pom.xml | 47 | ||||
-rw-r--r-- | deployment/docker/src/main/docker/Dockerfile | 2 |
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 |