summaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authordglFromAtt <dgl@research.att.com>2018-03-03 22:07:58 -0500
committerdglFromAtt <dgl@research.att.com>2018-03-03 22:10:47 -0500
commit89a5243e22360828ce6e50fe46b2b5f662ecbc59 (patch)
tree85dfefaa1b91221d787f8b76089a7fa4e4fa0fa8 /pom.xml
parent9f6f75a7362e402ec6ccb3a40d895600d5f32e90 (diff)
utilize docker-maven-plugin to create container
Change-Id: I7a4de614ce948f0ae7eb6fc852438f3270147151 Signed-off-by: dglFromAtt <dgl@research.att.com> Issue-ID: DMAAP-318 Signed-off-by: dglFromAtt <dgl@research.att.com>
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml101
1 files changed, 101 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index 6658514..518f638 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,100 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <imageName>${docker.image}</imageName>
+ <dockerDirectory>${project.basedir}</dockerDirectory>
+ <!-- <serverId>docker-hub</serverId> -->
+ <imageTags>
+ <imageTag>${artifact.version}</imageTag>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <forceTags>true</forceTags>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.basedir}</directory>
+ <excludes>
+ <exclude>target/**/*</exclude>
+ <exclude>pom.xml</exclude>
+ </excludes>
+ </resource>
+<!-- what is this?
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>**/**</include>
+ </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-project-version</id>
+ <phase>package</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image}</image>
+ <newName>${docker.push.registry}/${docker.image}:${artifact.version}</newName>
+ <skipDockerTag>${skip.docker.push}</skipDockerTag>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>tag-image-latest</id>
+ <phase>package</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${docker.image}</image>
+ <newName>${docker.push.registry}/${docker.image}:latest</newName>
+ <skipDockerTag>${skip.docker.push}</skipDockerTag>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>push-image-latest</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <imageName>${docker.push.registry}/${docker.image}:${artifact.version}</imageName>
+ <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>push-image</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <imageName>${docker.push.registry}/${docker.image}:latest</imageName>
+ <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
@@ -211,6 +305,13 @@
<sonar.jacoco.itReportPath>target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
<!-- Note: This list should match jacoco-maven-plugin's exclusion list below -->
<sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
+
+ <!-- docker image -->
+ <docker.image>onap/dmaap/buscontroller</docker.image>
+ <skip.docker.build>true</skip.docker.build>
+ <skip.docker.push>true</skip.docker.push>
+ <nexusproxy>https://nexus.onap.org</nexusproxy>
+ <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
</properties>
<description>Packaging Platform (DMaaP) Bus Controller API as a Docker container. </description>
</project>