Change pom to push new docker image
[dmaap/datarouter.git] / datarouter-prov / pom.xml
old mode 100644 (file)
new mode 100755 (executable)
index 07ddc84..a348c78
     <name>datarouter-prov</name>\r
     <url>https://github.com/att/DMAAP_DATAROUTER</url>\r
     <properties>\r
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
-        <maven.compiler.source>1.8</maven.compiler.source>\r
-        <maven.compiler.target>1.8</maven.compiler.target>\r
-        <docker.location>${basedir}/target/</docker.location>\r
         <sonar.language>java</sonar.language>\r
         <sonar.skip>false</sonar.skip>\r
-        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>\r
-        <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>\r
-        <sonar.jacoco.reportPath>${project.build.directory}/coverage-reports/jacoco.exec</sonar.jacoco.reportPath>\r
-        <sonar.jacoco.itReportPath>${project.build.directory}/coverage-reports/jacoco-it.exec\r
-        </sonar.jacoco.itReportPath>\r
         <sonar.jacoco.reportMissing.force.zero>true</sonar.jacoco.reportMissing.force.zero>\r
-        <sonar.projectVersion>${project.version}</sonar.projectVersion>\r
-        <nexusproxy>https://nexus.onap.org</nexusproxy>\r
-        <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>\r
-        <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>\r
-        <stagingNexusPath>/content/repositories/staging/</stagingNexusPath>\r
         <sitePath>/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</sitePath>\r
+\r
+        <docker.location>${basedir}/target/${artifactId}</docker.location>\r
+        <datarouter.prov.image.name>onap/dmaap/datarouter-prov</datarouter.prov.image.name>\r
     </properties>\r
     <dependencies>\r
         <dependency>\r
             <scope>compile</scope>\r
         </dependency>\r
     </dependencies>\r
+\r
+    <profiles>\r
+        <profile>\r
+            <id>docker</id>\r
+            <properties>\r
+                <skip.docker.build>false</skip.docker.build>\r
+                <skip.docker.tag>false</skip.docker.tag>\r
+                <skip.docker.push>false</skip.docker.push>\r
+            </properties>\r
+        </profile>\r
+    </profiles>\r
+\r
     <build>\r
         <finalName>datarouter-prov</finalName>\r
         <resources>\r
             <plugin>\r
                 <groupId>com.spotify</groupId>\r
                 <artifactId>docker-maven-plugin</artifactId>\r
-                <version>0.4.11</version>\r
+                <version>${docker.maven.plugin.version}</version>\r
                 <configuration>\r
-                    <imageName>onap/dmaap/datarouter-prov</imageName>\r
+                    <skipDockerBuild>false</skipDockerBuild>\r
+                    <imageName>${datarouter.prov.image.name}</imageName>\r
                     <dockerDirectory>${docker.location}</dockerDirectory>\r
                     <serverId>docker-hub</serverId>\r
-                    <registryUrl>https://${docker.registry}</registryUrl>\r
                     <imageTags>\r
                         <imageTag>${project.version}</imageTag>\r
                         <imageTag>latest</imageTag>\r
                     </imageTags>\r
                     <forceTags>true</forceTags>\r
+                    <resources>\r
+                        <resource>\r
+                            <targetPath>/</targetPath>\r
+                            <directory>${docker.location}</directory>\r
+                            <include>${project.build.finalName}.jar</include>\r
+                        </resource>\r
+                        <resource>\r
+                            <targetPath>/</targetPath>\r
+                            <directory>${project.build.directory}</directory>\r
+                            <include>**/**</include>\r
+                        </resource>\r
+                    </resources>\r
                 </configuration>\r
+                <executions>\r
+                    <execution>\r
+                        <id>build-image</id>\r
+                        <phase>install</phase>\r
+                        <goals>\r
+                            <goal>build</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <skipDockerBuild>${skip.docker.build}</skipDockerBuild>\r
+                        </configuration>\r
+                    </execution>\r
+                    <execution>\r
+                        <id>tag-image-project-version</id>\r
+                        <phase>install</phase>\r
+                        <goals>\r
+                            <goal>tag</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <image>${datarouter.prov.image.name}</image>\r
+                            <newName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:${project.version}</newName>\r
+                            <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
+                        </configuration>\r
+                    </execution>\r
+                    <execution>\r
+                        <id>tag-image-latest</id>\r
+                        <phase>install</phase>\r
+                        <goals>\r
+                            <goal>tag</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <image>${datarouter.prov.image.name}</image>\r
+                            <newName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:latest</newName>\r
+                            <skipDockerTag>${skip.docker.push}</skipDockerTag>\r
+                        </configuration>\r
+                    </execution>\r
+                    <execution>\r
+                        <id>push-image-latest</id>\r
+                        <phase>deploy</phase>\r
+                        <goals>\r
+                            <goal>push</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:${project.version}</imageName>\r
+                            <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
+                        </configuration>\r
+                    </execution>\r
+                    <execution>\r
+                        <id>push-image</id>\r
+                        <phase>deploy</phase>\r
+                        <goals>\r
+                            <goal>push</goal>\r
+                        </goals>\r
+                        <configuration>\r
+                            <imageName>${onap.nexus.dockerregistry.daily}/${datarouter.prov.image.name}:latest</imageName>\r
+                            <skipDockerPush>${skip.docker.push}</skipDockerPush>\r
+                        </configuration>\r
+                    </execution>\r
+                </executions>\r
             </plugin>\r
             <plugin>\r
                 <artifactId>maven-resources-plugin</artifactId>\r
                         <format>html</format>\r
                         <format>xml</format>\r
                     </formats>\r
+                    <check/>\r
                 </configuration>\r
             </plugin>\r
             <plugin>\r
                 <version>1.6.7</version>\r
                 <extensions>true</extensions>\r
                 <configuration>\r
-                    <nexusUrl>${nexusproxy}</nexusUrl>\r
+                    <nexusUrl>${onap.nexus.dockerregistry.daily}</nexusUrl>\r
                     <stagingProfileId>176c31dfe190a</stagingProfileId>\r
                     <serverId>ecomp-staging</serverId>\r
                 </configuration>\r
         <repository>\r
             <id>ecomp-releases</id>\r
             <name>DR Release Repository</name>\r
-            <url>${nexusproxy}${releaseNexusPath}</url>\r
+            <url>${onap.nexus.url}${releaseNexusPath}</url>\r
         </repository>\r
         <snapshotRepository>\r
             <id>ecomp-snapshots</id>\r
             <name>DR Snapshot Repository</name>\r
-            <url>${nexusproxy}${snapshotNexusPath}</url>\r
+            <url>${onap.nexus.url}${snapshotNexusPath}</url>\r
         </snapshotRepository>\r
         <site>\r
             <id>ecomp-site</id>\r
-            <url>dav:${nexusproxy}${sitePath}</url>\r
+            <url>dav:${onap.nexus.url}${sitePath}</url>\r
         </site>\r
     </distributionManagement>\r
     <pluginRepositories>\r
         <pluginRepository>\r
             <id>onap-plugin-snapshots</id>\r
-            <url>https://nexus.onap.org/content/repositories/snapshots/</url>\r
+            <url>${onap.nexus.url}${snapshotNexusPath}</url>\r
         </pluginRepository>\r
     </pluginRepositories>\r
-</project>
\ No newline at end of file
+</project>\r