summaryrefslogtreecommitdiffstats
path: root/datarouter-prov
diff options
context:
space:
mode:
authorezcoxem <emmett.cox>2018-07-31 15:54:56 +0100
committereronkeo <ronan.keogh@ericsson.com>2018-08-01 10:58:14 +0100
commitda23b25192b0f2838e27e93b88e05e07756adbb0 (patch)
treeb137a773669013aeb1aa6c3672c776d66218a92b /datarouter-prov
parentfa1da98c8618e2e51ae5bddd6eb28fc1fb407e52 (diff)
Change pom to push new docker image
Issue-ID: DMAAP-12 Change-Id: If621d0318a01855c57324b16f56597f10bc812c8 Signed-off-by: eronkeo <ronan.keogh@ericsson.com>
Diffstat (limited to 'datarouter-prov')
-rwxr-xr-x[-rw-r--r--]datarouter-prov/pom.xml118
1 files changed, 95 insertions, 23 deletions
diff --git a/datarouter-prov/pom.xml b/datarouter-prov/pom.xml
index 07ddc84a..a348c784 100644..100755
--- a/datarouter-prov/pom.xml
+++ b/datarouter-prov/pom.xml
@@ -33,24 +33,13 @@
<name>datarouter-prov</name>
<url>https://github.com/att/DMAAP_DATAROUTER</url>
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
- <docker.location>${basedir}/target/</docker.location>
<sonar.language>java</sonar.language>
<sonar.skip>false</sonar.skip>
- <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
- <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
- <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>
- <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec
- </sonar.jacoco.itReportPath>
<sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>
- <sonar.projectVersion>${project.version}</sonar.projectVersion>
- <nexusproxy>https://nexus.onap.org</nexusproxy>
- <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
- <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
- <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>
<sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>
+
+ <docker.location>${basedir}/target/${artifactId}</docker.location>
+ <datarouter.prov.image.name>onap/dmaap/datarouter-prov</datarouter.prov.image.name>
</properties>
<dependencies>
<dependency>
@@ -229,6 +218,18 @@
<scope>compile</scope>
</dependency>
</dependencies>
+
+ <profiles>
+ <profile>
+ <id>docker</id>
+ <properties>
+ <skip.docker.build>false</skip.docker.build>
+ <skip.docker.tag>false</skip.docker.tag>
+ <skip.docker.push>false</skip.docker.push>
+ </properties>
+ </profile>
+ </profiles>
+
<build>
<finalName>datarouter-prov</finalName>
<resources>
@@ -302,18 +303,88 @@
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
- <version>0.4.11</version>
+ <version>${docker.maven.plugin.version}</version>
<configuration>
- <imageName>onap/dmaap/datarouter-prov</imageName>
+ <skipDockerBuild>false</skipDockerBuild>
+ <imageName>${datarouter.prov.image.name}</imageName>
<dockerDirectory>${docker.location}</dockerDirectory>
<serverId>docker-hub</serverId>
- <registryUrl>https://${docker.registry}</registryUrl>
<imageTags>
<imageTag>${project.version}</imageTag>
<imageTag>latest</imageTag>
</imageTags>
<forceTags>true</forceTags>
+ <resources>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${docker.location}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ <resource>
+ <targetPath>/</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>**/**</include>
+ </resource>
+ </resources>
</configuration>
+ <executions>
+ <execution>
+ <id>build-image</id>
+ <phase>install</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ <configuration>
+ <skipDockerBuild>${skip.docker.build}</skipDockerBuild>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-image-project-version</id>
+ <phase>install</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${datarouter.prov.image.name}</image>
+ <newName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:${project.version}</newName>
+ <skipDockerTag>${skip.docker.push}</skipDockerTag>
+ </configuration>
+ </execution>
+ <execution>
+ <id>tag-image-latest</id>
+ <phase>install</phase>
+ <goals>
+ <goal>tag</goal>
+ </goals>
+ <configuration>
+ <image>${datarouter.prov.image.name}</image>
+ <newName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}: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>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:${project.version}</imageName>
+ <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ </configuration>
+ </execution>
+ <execution>
+ <id>push-image</id>
+ <phase>deploy</phase>
+ <goals>
+ <goal>push</goal>
+ </goals>
+ <configuration>
+ <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:latest</imageName>
+ <skipDockerPush>${skip.docker.push}</skipDockerPush>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
@@ -473,6 +544,7 @@
<format>html</format>
<format>xml</format>
</formats>
+ <check/>
</configuration>
</plugin>
<plugin>
@@ -481,7 +553,7 @@
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
- <nexusUrl>${nexusproxy}</nexusUrl>
+ <nexusUrl>${onap.nexus.dockerregistry.daily}</nexusUrl>
<stagingProfileId>176c31dfe190a</stagingProfileId>
<serverId>ecomp-staging</serverId>
</configuration>
@@ -550,22 +622,22 @@
<repository>
<id>ecomp-releases</id>
<name>DR Release Repository</name>
- <url>${nexusproxy}${releaseNexusPath}</url>
+ <url>${onap.nexus.url}${releaseNexusPath}</url>
</repository>
<snapshotRepository>
<id>ecomp-snapshots</id>
<name>DR Snapshot Repository</name>
- <url>${nexusproxy}${snapshotNexusPath}</url>
+ <url>${onap.nexus.url}${snapshotNexusPath}</url>
</snapshotRepository>
<site>
<id>ecomp-site</id>
- <url>dav:${nexusproxy}${sitePath}</url>
+ <url>dav:${onap.nexus.url}${sitePath}</url>
</site>
</distributionManagement>
<pluginRepositories>
<pluginRepository>
<id>onap-plugin-snapshots</id>
- <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ <url>${onap.nexus.url}${snapshotNexusPath}</url>
</pluginRepository>
</pluginRepositories>
-</project> \ No newline at end of file
+</project>